This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix($compile): only pass isolate scope to children that belong to the…
… isolate directive I had to fix one unit test, as it assumed the broken behavior, where application template gets the isolate scope of other (isolate) directive, rather than the regular scope. BREAKING CHANGE: Child elements that are defined either in the application template or in some other directives template do not get the isolate scope. In theory, nobody should rely on this behavior, as it is very rare - in most cases the isolate directive has a template.
- Loading branch information
Showing
2 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d0efd5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an option to prevent this behavior?
d0efd5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if i setup templateUrl to null should it help?
d0efd5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not a valid use of it? http://stackoverflow.com/questions/20344068/using-a-directives-compile-function-with-an-isolate-scope-seems-to-access-the-w
d0efd5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you should be able to receive the isolate scope if you are constructing the template programatically?
d0efd5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is FAIL and messed up my app badly now i can't do something like this:
lrApp.directive('foo', function () {
return {
restrict: 'E',
scope : {
yup : '@check'
},
link: function (scope, iElement, iAttrs) {
scope.blah = 'yes ye syes';
}
};
});
{{blah}} {{yup}}
and i should be able to ....