Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 852
Richy Avatar asked Mar 24 '26 22:03

Richy


1 Answers

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>
like image 70
ojus kulkarni Avatar answered Mar 26 '26 12:03

ojus kulkarni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!