Richy
Richy

Reputation: 167

Angular API Objects

Im creating a link grabbing the data from below

enter image description here

<a href="#">{{ product.category.value }}</a>

This works great but having problems grabbing a slug from the data object.

enter image description here

how do I get the slug?

<a ui-sref="{{ product.category.data.109923...slug }}">{{ product.category.value }}</a>

Please remember the 109923 object will change on different pages so cant be hard coded in. I hope someone can help

Upvotes: 3

Views: 68

Answers (1)

ojus kulkarni
ojus kulkarni

Reputation: 1907

Watch your changeable object by using $watch Like :

$scope.$watch('data', function (watch) {
  // watch your object here
})

May be this will help you

OR

You can use ng-repeat for your data, Like :

<div ng-repeat="d in data" >
  <a ui-sref="">{{ product.category.d.109923...slug }}</a>
</div>

Upvotes: 4

Related Questions