-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Isolate scope weird behavior based on directive's name. #12215
Comments
Without looking deep into, it has clearly to do with directive priorities. The order of processing its directive changes the outcome, because (for some reason) the check about isolate+new scope is skipped when there is a
I am not sure if we ever do check when the template arrives (or if we check properly). |
A little more context (Angular internals stuff - for source-viewer only :P): We indeed fail to properly check, because the As a result, we (accidentally ?) allow directives that request a new normal scope and a new isolate scope on the same element (as long as the isolate-scope-requesting directive specifies |
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 it now an error is thrown (as expected). Fixes angular#12215
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
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
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
I have 2 directives on the same element. One has isolate scope (scope: {}), the other one inherits scope from parent (scope: true). Angular version 1.3.16 (and even 1.4).
This should throw an exception, but it doesn't if my directive's name starts with letter "o" or any following letter in the alphabet.
See for your self in the following plunk by simply changing the directive's name first letter:
http://plnkr.co/edit/oL1WLw
The text was updated successfully, but these errors were encountered: