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

fix($compile): throw error when requesting new and isolate scopes (async) #12217

Closed
wants to merge 1 commit into from

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Jun 26, 2015

While directives are not allowed to request both a new (normal) and an isolate scope on the same element, the relevant check was not performed correctly when the directive requesting the isolate scope had a lower priority and specified a templateUrl.
In that case, the check was deferred until the template was fetched, but the info about other directives requesting a new (normal) scope was not properly preserved (in previousCompileContext).

This commit fixes this, so now an error is thrown (as expected).

Fixes #12215

Review on Reviewable

@gkalpak gkalpak force-pushed the fix-$compile-throw-multidir branch from 0ad06c6 to 0d92eb6 Compare June 26, 2015 15:02
gkalpak added a commit to gkalpak/angular.js that referenced this pull request Jun 26, 2015
While directives are not allowed to request both a new (normal) and an
isolate scope on the same element, the relevant check was not performed
correctly when the directive requesting the isolate scope had a lower
priority and specified a `templateUrl`.
In that case, the check was deferred until the template was fetched, but
the info about other directives requesting a new (normal) scope was not
properly preserved (in `previousCompileContext`).

This commit fixes this, so now an error is thrown (as expected).

Fixes angular#12215
Closes angular#12217
@Narretz
Copy link
Contributor

Narretz commented Jun 26, 2015

We should really fix this. This might be a breaking change for some apps, although it's technically a fix. If you didn't know you were not supposed to use it this way, you'll simply experience your app breaking.

@Narretz Narretz added this to the 1.5.x - migration-facilitation milestone Jun 26, 2015
While directives are not allowed to request both a new (normal) and an
isolate scope on the same element, the relevant check was not performed
correctly when the directive requesting the isolate scope had a lower
priority and specified a `templateUrl`.
In that case, the check was deferred until the template was fetched, but
the info about other directives requesting a new (normal) scope was not
properly preserved (in `previousCompileContext`).

This commit fixes this, so now an error is thrown (as expected).

Fixes angular#12215
Closes angular#12217
@gkalpak gkalpak force-pushed the fix-$compile-throw-multidir branch from 0d92eb6 to c715553 Compare June 26, 2015 18:29
@petebacondarwin
Copy link
Contributor

Reviewed 1 of 2 files at r1.
Review status: 1 of 2 files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@petebacondarwin
Copy link
Contributor

Reviewed 1 of 2 files at r1.
Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@petebacondarwin
Copy link
Contributor

LGTM


Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@petebacondarwin
Copy link
Contributor

I don't think it would be a breaking change, since it is invalid to have new scope and isolate scope together.


Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@gkalpak gkalpak closed this in 6333d65 Jun 28, 2015
@gkalpak gkalpak deleted the fix-$compile-throw-multidir branch June 28, 2015 08:35
@gkalpak gkalpak changed the title fix($compile): throw error when requestng new and isolate scopes (async) fix($compile): throw error when requesting new and isolate scopes (async) Jun 29, 2015
netman92 pushed a commit to netman92/angular.js that referenced this pull request Aug 8, 2015
While directives are not allowed to request both a new (normal) and an
isolate scope on the same element, the relevant check was not performed
correctly when the directive requesting the isolate scope had a lower
priority and specified a `templateUrl`.
In that case, the check was deferred until the template was fetched, but
the info about other directives requesting a new (normal) scope was not
properly preserved (in `previousCompileContext`).

This commit fixes this, so now an error is thrown (as expected).

Fixes angular#12215
Closes angular#12217
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Isolate scope weird behavior based on directive's name.
4 participants