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.
In case I want to use directives which modifies the DOM structure (ng-if/ng-repeat) in the fallback content of the transclusion and I give another content when using the component, I've got an javascript exception, though the component seems working.
angular.js:13550 TypeError: Cannot read property 'insertBefore' of null
at forEach.after (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:3603:13)
at Object.JQLite.(anonymous function) [as after] (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:3687:17)
at domInsert (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:5229:35)
at Object.enter (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:5397:9)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:25542:26
at publicLinkFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:8276:29)
at lazyCompilation (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:8615:25)
at boundTranscludeFn (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:8414:16)
at controllersBoundTransclude (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:9143:20)
at ngIfWatchAction (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js:25533:15)
The text was updated successfully, but these errors were encountered:
Strange, this happens only when you use .component, not when you use .directive. Since component is built on directive, I wonder where the problem lies. Maybe there's timing difference where the component takes a bit longer to compile.
It does happen with directives too, as long as you use the same DDO properties. Specifically, it seems to be the controllerAs: '$ctrl' that triggers it (and only for $ctrl !?!): plnkr
I had same issue but with ng-repeat and component inside of it. I figure out that problem appears when we have unhandled exception during nodeLinkFn running (in my case in $onInit lifecycle hook), sooo if we have exception there, angular.js skips prelinking and postlinking routines and as result we have scope mess.
With multi-element ng-repeat there is a similar problem: VM1362 angular.js:13236 Error: [$compile:uterdir] Unterminated attribute, found 'ng-repeat-start' but no matching 'ng-repeat-end' found. plnkr
From a quick check the original issue seems to be fixed in 1.5.8 and works as expected till the latest 1.5.10 (demo).
The issue reported by @jamie-pate is totally unrelated (but still a valid issue). Let's track it in #15554.
In case I want to use directives which modifies the DOM structure (ng-if/ng-repeat) in the fallback content of the transclusion and I give another content when using the component, I've got an javascript exception, though the component seems working.
Angular version: 1.5.5
Plunkr: https://plnkr.co/edit/A4nxJDDy8OUBPc6hiVqq?p=info
The text was updated successfully, but these errors were encountered: