Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Multiple expressions in the same tag are not evaluated #8646

Closed
adtanre opened this issue Aug 17, 2014 · 3 comments
Closed

Multiple expressions in the same tag are not evaluated #8646

adtanre opened this issue Aug 17, 2014 · 3 comments

Comments

@adtanre
Copy link

adtanre commented Aug 17, 2014

1.3.0-beta.15 and earlier

Multiple expressions in the same tag are evaluated normally.

<!DOCTYPE html>
<html ng-app>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.15/angular.min.js"></script>
  </head>
  <body>
    <p>{{1+1}} {{2+2}}</p>
  </body>
</html>

Output: 2 4

<!DOCTYPE html>
<html ng-app>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.15/angular.min.js"></script>
  </head>
  <body>
    <p><span>{{1+1}}</span> <span>{{2+2}}</span></p>
  </body>
</html>

Output: 2 4

1.3.0-beta.16 and later

Multiple expressions in the same tag are not evaluated (except when they are in separate tags).

<!DOCTYPE html>
<html ng-app>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.16/angular.min.js"></script>
  </head>
  <body>
    <p>{{1+1}} {{2+2}}</p>
  </body>
</html>

Output: {{1+1}} {{2+2}}

<!DOCTYPE html>
<html ng-app>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.16/angular.min.js"></script>
  </head>
  <body>
    <p><span>{{1+1}}</span> <span>{{2+2}}</span></p>
  </body>
</html>

Output: 2 4


Is this change intentional? It is not mentioned in the 1.3.0-beta.16 changelog.

@adtanre adtanre changed the title Multiple expressions are not evaluated in the same tag Multiple expressions in the same tag are not evaluated Aug 17, 2014
@pkozlowski-opensource
Copy link
Member

@adtanre wow, this is definitively not intentional and looks like a bug to me. Fortunately it seems to be fixed in the latest snapshot: http://plnkr.co/edit/8fJ8vTWpIffqlbJ3ik7Q?p=preview

@pkozlowski-opensource
Copy link
Member

Hmm, it was still broken in beta 18 (see http://plnkr.co/edit/K9TUmFhBc7o0ClhJJOyE?p=preview) so it must have been fixed in the last 5 days; the only fix commits during this time are bf0e837 and b9389b2 (this is probably not linked). So it was either one of the mentioned commits or Igor's perf optimisations that have fixed this.

Good that this is fixed but I'm a bit surprised that we haven't had any test that could catch this issue :-/ @rodyhaddad - before I start bisecting - does bf0e837 sound like a possible fix for this issue? Do we need any additional test for this case?

@rodyhaddad
Copy link
Contributor

This got introduced by #7700 that changed $watchGroup, and then #8396 optimized $watchGroup and fixed the bug at the same time

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants