I'm new to AngularJs and still learning the things, I'm creating a menu 
with items that are clickable. When someone clicks on the item it will 
redirect to a view using the route name provided in the href, the catch 
here is that my menu will be generates out of the scope from the controller 
using the ng-repeat. I want to change my href value based on the item 
value, so that the corresponding view will be loaded based on route, here 
is my mark up and the controller that populates the scope. Can someone help 
me what is the best way to do this.

My href values (which points to the route) here in the below code 
'#Categories', should be changing based on the c.name. Example: if c.name 
is 'ABC' i should route the user to 'root1/ABC/:123' else if c.name is 
'DEF' i should route the user to 'root2/DEF'


Any help on this is highly appreciated.

<a data-ng-repeat="c in vm.List | orderBy: 'order'" 
href="#Categories/{{c.category}}/{{c.name}}" data-ng-show="c.count >0">


function getHomeConfigsCtrl($http, iService, $routeParams) {
    var vm = this;
    vm.List = [];
    var promise =
        iService.getConfig(ID);
    promise.then(
       function (result) {
           angular.forEach(result.data.menu, function (value, key) {
               vm.List.push(value);
           });
       },
       function (errorPayload) {
           $log.error('failure loading home page config', errorPayload);
       });
};

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to