angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

directive scope clash

Open cyberflohr opened this issue 13 years ago • 4 comments

I've written to directives which are applied to the same DOM element.

Directive ONE has no explicit scope declaration (just a link function), directive TWO declares { scope : true, link : linkFctn }

The problem now is, that no new scope is created. I can see that the class=ng-scope is set for the DOM Element, but the Angular JS Properties for this Element has the same $id, as the parent element.

Was not easy to find the problem. Maybe angular can throw an exception or logs a message to the console, if such a directive scope clash is detected during compile time?

regards, wolf

cyberflohr avatar Feb 06 '13 15:02 cyberflohr

@cyberflohr I'm not sure if I'm reading your correctly... Are you talking about the situation as in this plunker: http://plnkr.co/edit/mx9u1v6QhtEDL9lojeAx?p=preview

If not, could you please provide the reproduce scenario?

pkozlowski-opensource avatar Feb 06 '13 18:02 pkozlowski-opensource

YES - the plunker code snippet describes exactly my scope problem!

cyberflohr avatar Feb 06 '13 20:02 cyberflohr

Interesting: if I move the directive two to a child element it behaves as expected: http://plnkr.co/edit/fa6rTNfSfpRT0XCtsLWx?p=preview

pkozlowski-opensource avatar Feb 07 '13 19:02 pkozlowski-opensource

As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.

Please try the newest versions of Angular (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.

Thanks!

btford avatar Aug 24 '13 00:08 btford