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 has been archived by the owner on Apr 12, 2024. It is now read-only.
As the title says, ngMessagesInclude processed after parent ngMessages is removed from DOM. It fails because angular can't find parent controller for linking inner messages. It doesn't happen when ngMessage's are inlined inside the ngMessages element, or while parent element is still present on DOM.
At event (A), messages.html is downloaded. Because it uses $templateRequest, linking is stalled until server returns. Meanwhile, event (B) proceeds with the removal of ngMessages and its children from DOM. Later, ngMessagesInclude content arrives and angular will compile it. But at that point there's no way to retrieve ngMessages controller anymore.
Messages imported with `ngMessagesInclude` are loaded asynchronously and
they can arrive after the ngMessages element has already been removed from DOM.
Previously we tried to compile these messages and that caused a `$compile:ctreq`
error. Now they are silently ignored if `ngMessagesInclude`'s scope has already
been destroyed.
Closes#12695Closes#14640
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As the title says, ngMessagesInclude processed after parent ngMessages is removed from DOM. It fails because angular can't find parent controller for linking inner messages. It doesn't happen when
ngMessage
's are inlined inside thengMessages
element, or while parent element is still present on DOM.Have an ng-messages like this:
Submission is triggered by:
At event (A),
messages.html
is downloaded. Because it uses$templateRequest
, linking is stalled until server returns. Meanwhile, event (B) proceeds with the removal ofngMessages
and its children from DOM. Later, ngMessagesInclude content arrives and angular will compile it. But at that point there's no way to retrievengMessages
controller anymore.Plnkr: http://plnkr.co/edit/0GOOLERvfj7n9vDVEyZp?p=preview
Most of the time, it will happen together with an
ngIf
condition.Tested against version 1.4.4.
I've found a way to avoid that:
To solve that at component side, the
require: '^^ngMessages'
could be made optional and check that condition during linking.The text was updated successfully, but these errors were encountered: