Reputation: 377
i'm working on something pretty simple but there is this one thing I just can't get to work. Part of my application requires me to create href tags dynamically. But the part of the view that holds the navigation links always loads before i have a chance to inject the data into the scope.
<a ng-href="#campus/{{$scope.currentCampusName}}/floor/{{$scope.currentFloor + 1}}">up</a>
that's the url i'm using and it always ends up like
<baseurl>#/campus//floor/1
the strange part is that another block, which uses ng-repeat does wait for the controller to load it seems. So that loads correctly, but the link doesn't.
I've read about resolve but at this point i'm just confused... why does it work with ng-repeat but not in the ng-href ? Not to mention, what's the difference between using resolve and just calling the async service in your controller?
What am i missing?
Upvotes: 0
Views: 407
Reputation: 2802
You don't need $scope
in interpolation mark {{}}
<a ng-href="#campus/{{currentCampusName}}/floor/{{currentFloor + 1}}">up</a>
Upvotes: 2