You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Hi, Angularjs, I think I found something wrong.
I create thress directives name my-d, my-e and my-f just like bellow http://plnkr.co/edit/zTulGu270PM0qTSlI7Fj?p=preview
here my-d, my-e with scope true, and my-f with scope be an Object, and my-f has a template. In the html, I just put the three directives in a div tag, and nothing wrong. the template of my-f just shown.
But, when I change directive myE's name to myF, and vice versa.
and open Chrome's Developer tools, there's an Error
Error: [$compile:multidir] Multiple directives [myE, myF] asking for new/isolated scope on:
I think this is a bug in applyDirectivesToNode function, what I mentioned bellow is for the file angular.js 1.2.16.
line 6276-6288
if(directiveValue=directive.scope){newScopeDirective=newScopeDirective||directive;// skip the check for directives with async templates, we'll check the derived sync// directive when the template arrivesif(!directive.templateUrl){assertNoDuplicate('new/isolated scope',newIsolateScopeDirective,directive,$compileNode);if(isObject(directiveValue)){newIsolateScopeDirective=directive;}}}
if the current directive's scope property is an Object, then newIsolateScopeDirective = directive; so if there's another directive in the directives array after the current directive, then the assertNoDuplicate will always throw an Error, because in assertNoDuplicate function
line 6878-6883
functionassertNoDuplicate(what,previousDirective,directive,element){if(previousDirective){throw$compileMinErr('multidir','Multiple directives [{0}, {1}] asking for {2} on: {3}',previousDirective.name,directive.name,what,startingTag(element));}}
once previousDirective is not undefined, then an error is thrown. And the sccond code snippet will trigger prolem. But the first one will not, because my-f is the last directive in the directives array.
I can't carry out a solution for this issue. Looking forward to your replay!
The text was updated successfully, but these errors were encountered:
I can't carry out a solution for this issue. Looking forward to your replay!
Sure you can, just write a failing test (a case where multiple new or isolate scopes are created in a single directive where the directive doesn't throw) and hack on it until it does ;)
I can try to make that more sane tomorrow if you don't want to do it.
Hi, Angularjs, I think I found something wrong.
I create thress directives name my-d, my-e and my-f just like bellow
http://plnkr.co/edit/zTulGu270PM0qTSlI7Fj?p=preview
here my-d, my-e with scope true, and my-f with scope be an Object, and my-f has a template. In the html, I just put the three directives in a div tag, and nothing wrong. the template of my-f just shown.
But, when I change directive myE's name to myF, and vice versa.
and open Chrome's Developer tools, there's an Error
Error: [$compile:multidir] Multiple directives [myE, myF] asking for new/isolated scope on:
I think this is a bug in applyDirectivesToNode function, what I mentioned bellow is for the file angular.js 1.2.16.
line 6276-6288
if the current directive's scope property is an Object, then newIsolateScopeDirective = directive; so if there's another directive in the directives array after the current directive, then the assertNoDuplicate will always throw an Error, because in assertNoDuplicate function
line 6878-6883
once previousDirective is not undefined, then an error is thrown. And the sccond code snippet will trigger prolem. But the first one will not, because my-f is the last directive in the directives array.
I can't carry out a solution for this issue. Looking forward to your replay!
The text was updated successfully, but these errors were encountered: