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

[1.4.9] $compile:nonassign error in directive #13832

Closed
s-KaiNet opened this issue Jan 23, 2016 · 4 comments
Closed

[1.4.9] $compile:nonassign error in directive #13832

s-KaiNet opened this issue Jan 23, 2016 · 4 comments

Comments

@s-KaiNet
Copy link

I created directive, isolated scope has a bi-directional binding isOpen: '='. In html I didn't set is-open attribute, but do it in a click handler. In that case $compile:nonassign error is thrown.
Here the a simple plunk demonstrating the issue - plunk (error is in console)

For version 1.4.8 all works good - here the same plunk but for 1.4.8 version.
This can be fixed but making binding optional isOpen: '=?', but is this a bug in 1.4.9 or not?

@gkalpak
Copy link
Member

gkalpak commented Jan 23, 2016

This seems like an intentional change made in 7bb2414 (with a relevant test added in 45c5688) to fix #13367 (which is about a regression that was introduced in 1.4.0-beta.3 as part of 6a38dbf).

@wesleycho
Copy link
Contributor

I encountered this too when upgrading from 1.4.7 to 1.4.9 - that was actually the main reason I opened #13827.

While this is a regression, I think the proper fix is to indeed mark it with ? because this involves setting two watchers internally if there is a two way binding, and it doesn't make sense to do so if the attribute isn't set.

@lgalfaso
Copy link
Contributor

Directives that use = binding the parameter is mandatory. A change so this is clear landed with 4ff9c02

@AckerApple
Copy link

This issue breaks my 1.4.6 angular code. I can't go look at every single controller. I will just be putting a question mark after EVERY scope attribute just so I can move on without error.

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

5 participants