javascript - angularjs: why ng-click doesn't seem to evaluate {{}} -
In an NG-Enhance tag, I have a ng-click that has a code for evaluating the following code :
& lt; Div ng-repeat = "phase in phase" class = "selection phase phase {{stage.stage}}" ng-click = "change page ('plantstage / {{stage.id}}')" & gt; However, in the safari inspector, I think the code has been evaluated as follows ??
& lt; Div ng-repeat = "phase in stages" class = "selection phase step 6" ng-click = "replace page ('plantstage / florence')" & gt; one click
.corn.page.html # / plantStages / {{step .id}} < / Pre> Controller has a change page:
$ scope.changePage = function (page) {var url = "kws.corn .page.html # /" + Page; Console.log ("Change Page" + Page + "with Url" + url); Document.location.href = url; };
Since ng-click a corner instruction You do not have to do this in {{}} : ng-click = "change page ('plantstage /' + forum.id) " The above show's work and the preferred way.
It is true that the Inspector shows the interpolated value, but it is too late in Konner $ digest ng-click Code> Cycle
Comments
Post a Comment