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

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -