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

Possible bug: Optional binding =? not required anymore in 1.4 where it is in 1.3 #13367

Closed

Description

@cburgdorf

This is a follow up to #9216 (comment)

I noticed that there is a breaking change regarding =? between 1.3 and 1.4.

This example throws with an exception when you try to toggle the second zippy because it doesn't use the open binding and the binding isn't marked as optional. The example is based on 1.3.

http://plnkr.co/edit/Ef2iKOde3TmGzJHRGEhE?p=preview

The same example using 1.4 does not throw however.

http://plnkr.co/edit/cWxO6shBz7OaiewCDMHp?p=preview

Activity

  1. petebacondarwin commented on Nov 24, 2015

    @petebacondarwin
    Contributor

    It seems that if the value is non-assignable we now never call the watch handler for setting the parent value.

    We are still creating the correct parentSet function, at https://github.com/angular/angular.js/blob/master/src/ng/compile.js#L2754, which will throw the exception.

    And we are still creating the watches correctly at https://github.com/angular/angular.js/blob/master/src/ng/compile.js#L2780

    But for some reason the handler never gets fired by the digest. I think this could be some optimisation that sees that the values are never going to change and so doesn't bother watching?

  2. petebacondarwin commented on Nov 24, 2015

    @petebacondarwin
    Contributor

    It appears between 1.4.0-beta.2 and 1.4.0-beta.3

  3. petebacondarwin commented on Nov 24, 2015

    @petebacondarwin
    Contributor

    git bisect tells us that this bug did indeed appear in 6a38dbf

  4. cburgdorf commented on Nov 24, 2015

    @cburgdorf
    ContributorAuthor

    I wonder if that's really a bug or a feature? The question would be if there are any downsides of the behavior because for this example it turns out as something positive. It makes the example work out of the box without having to know about optional bindings.

  5. lgalfaso commented on Nov 24, 2015

    @lgalfaso
    Contributor

    I think this is an oversight on the PR that @petebacondarwin pointed out.

  6. added 2 commits that reference this issue on Nov 24, 2015
    d6e166a
    7bb2414
  7. added a commit that references this issue on Nov 25, 2015
    45c5688
  8. added a commit that references this issue on Nov 25, 2015
    b2a937d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions