andycds
andycds

Reputation: 15

What has changed in angularjs 1.2.0rc1 to 1.2.0, that breaks this code?

I'd like to know what changes in angularjs from version 1.2.0rc to 1.2.0, that breaks this code:

http://codepen.io/anon/pen/Iwptv

I know how to correct, just replace

    ng-click="alertar({{$index}})"

by

    ng-click="alertar($index)"

Why ng-click has a different behavior from other elements, like class or id, where the use of curly braces is still necessary? It was a breaking change?

Upvotes: 1

Views: 67

Answers (1)

maxisam
maxisam

Reputation: 22735

I think it is caused by this one 79223eae

Previously, the interpolation priority was -100 in 1.2.0-rc.2, and 100 before 1.2.0-rc.2. Before this change the binding was setup in the post-linking phase.

Now the attribute interpolation (binding) executes as a directive with priority 100 and the binding is set up in the pre-linking phase.

However, according to the document

<ANY ng-click="{expression}">

So I think you shouldn't use curly braces

Upvotes: 1

Related Questions