This repository was 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.4k
bug(ngMessages): ngMessagesInclude crashes inside ngRepeat #11196
Milestone
Comments
Looking into it right now. |
matsko
added a commit
to matsko/angular.js
that referenced
this issue
Feb 26, 2015
…ed in the DOM NgRepeat and any other directives that alter the DOM structure using transclusion may cause ngMessagesInclude to behave in an unpredictable manner. This fix ensures that the element containing the ngMessagesInclude directive is persisted in the DOM and its downloaded template code will be placed inside of that element. Despite there now being an extra child container within the ngMessages element, the selection process of finding the next message to display still works in the same way. BREAKING CHANGE: From here on the ngMessageInclude directive will be persisted in the dom alongside any adjacent ngMessage elements. The interior ngMessage elements present within the ngMessageInclude template will be stored as child elements. The reasoning for this is to avoid any collision with ngRepeat or any other directive elements that may cause problems with inherited controllers, scopes and transclusion. This patch shouldn't have any effect on your JavaScript code, however when it comes to animations and CSS styling please note that the structure of DOM child elements is different. ```html <!-- before (1.4.0-beta.5 and lower) --> <div ng-message="val"> <div ng-message="error1">...</div> <!-- ng-messages-include="aAndB.html" put this in here --> <div ng-message="errorA">...</div> <div ng-message="errorB">...</div> <div ng-message="error10">...</div> <div> <!-- now --> <div ng-message="val"> <div ng-message="error1">...</div> <!-- ng-messages-include="aAndB.html" put this in here --> <div ng-messages-include="aAndB.html"> <div ng-message="errorA">...</div> <div ng-message="errorB">...</div> </div> <div ng-message="error10">...</div> <div> ``` Closes angular#11196
matsko
added a commit
to matsko/angular.js
that referenced
this issue
Feb 26, 2015
…ed in the DOM NgRepeat and any other directives that alter the DOM structure using transclusion may cause ngMessagesInclude to behave in an unpredictable manner. This fix ensures that the element containing the ngMessagesInclude directive is persisted in the DOM and its downloaded template code will be placed inside of that element. Despite there now being an extra child container within the ngMessages element, the selection process of finding the next message to display still works in the same way. BREAKING CHANGE: From here on the ngMessageInclude directive will be persisted in the dom alongside any adjacent ngMessage elements. The interior ngMessage elements present within the ngMessageInclude template will be stored as child elements. The reasoning for this is to avoid any collision with ngRepeat or any other directive elements that may cause problems with inherited controllers, scopes and transclusion. This patch shouldn't have any effect on your JavaScript code, however when it comes to animations and CSS styling please note that the structure of DOM child elements is different. ```html <!-- before (1.4.0-beta.5 and lower) --> <div ng-message="val"> <div ng-message="error1">...</div> <!-- ng-messages-include="aAndB.html" put this in here --> <div ng-message="errorA">...</div> <div ng-message="errorB">...</div> <div ng-message="error10">...</div> <div> <!-- now --> <div ng-message="val"> <div ng-message="error1">...</div> <!-- ng-messages-include="aAndB.html" put this in here --> <div ng-messages-include="aAndB.html"> <div ng-message="errorA">...</div> <div ng-message="errorB">...</div> </div> <div ng-message="error10">...</div> <div> ``` Closes angular#11196
matsko
added a commit
to matsko/angular.js
that referenced
this issue
Feb 26, 2015
…ed in the DOM NgRepeat and any other directives that alter the DOM structure using transclusion may cause ngMessagesInclude to behave in an unpredictable manner. This fix ensures that the element containing the ngMessagesInclude directive is persisted in the DOM and its downloaded template code will be placed inside of that element. Despite there now being an extra child container within the ngMessages element, the selection process of finding the next message to display still works in the same way. BREAKING CHANGE: From here on the ngMessageInclude directive will be persisted in the dom alongside any adjacent ngMessage elements. The interior ngMessage elements present within the ngMessageInclude template will be stored as child elements. The reasoning for this is to avoid any collision with ngRepeat or any other directive elements that may cause problems with inherited controllers, scopes and transclusion. This patch shouldn't have any effect on your JavaScript code, however when it comes to animations and CSS styling please note that the structure of DOM child elements is different. ```html <!-- before (1.4.0-beta.5 and lower) --> <div ng-message="val"> <div ng-message="error1">...</div> <!-- ng-messages-include="aAndB.html" put this in here --> <div ng-message="errorA">...</div> <div ng-message="errorB">...</div> <div ng-message="error10">...</div> <div> <!-- now --> <div ng-message="val"> <div ng-message="error1">...</div> <!-- ng-messages-include="aAndB.html" put this in here --> <div ng-messages-include="aAndB.html"> <div ng-message="errorA">...</div> <div ng-message="errorB">...</div> </div> <div ng-message="error10">...</div> <div> ``` Closes angular#11196
@adrianandreias #11199 fixes the issue. And your demo has been tested against it and it works. |
matsko
added a commit
to matsko/angular.js
that referenced
this issue
Feb 27, 2015
…ssageInclude ngRepeat and any other directives that alter the DOM structure using transclusion may cause ngMessagesInclude to behave in an unpredictable manner. This fix ensures that the element containing the ngMessagesInclude directive will stay in the DOM to avoid these issues. Closes angular#11196
matsko
added a commit
to matsko/angular.js
that referenced
this issue
Feb 27, 2015
…ssagesInclude ngRepeat and any other directives that alter the DOM structure using transclusion may cause ngMessagesInclude to behave in an unpredictable manner. This fix ensures that the element containing the ngMessagesInclude directive will stay in the DOM to avoid these issues. Closes angular#11196
matsko
added a commit
to matsko/angular.js
that referenced
this issue
Feb 27, 2015
…ssagesInclude ngRepeat and any other directives that alter the DOM structure using transclusion may cause ngMessagesInclude to behave in an unpredictable manner. This fix ensures that the element containing the ngMessagesInclude directive will stay in the DOM to avoid these issues. Closes angular#11196
matsko
added a commit
to matsko/angular.js
that referenced
this issue
Feb 27, 2015
…ssagesInclude ngRepeat and any other directives that alter the DOM structure using transclusion may cause ngMessagesInclude to behave in an unpredictable manner. This fix ensures that the element containing the ngMessagesInclude directive will stay in the DOM to avoid these issues. Closes angular#11196
Fixed via #11199 |
matsko
added a commit
that referenced
this issue
Feb 27, 2015
…ssagesInclude ngRepeat and any other directives that alter the DOM structure using transclusion may cause ngMessagesInclude to behave in an unpredictable manner. This fix ensures that the element containing the ngMessagesInclude directive will stay in the DOM to avoid these issues. Closes #11196
netman92
pushed a commit
to netman92/angular.js
that referenced
this issue
Aug 8, 2015
…ssagesInclude ngRepeat and any other directives that alter the DOM structure using transclusion may cause ngMessagesInclude to behave in an unpredictable manner. This fix ensures that the element containing the ngMessagesInclude directive will stay in the DOM to avoid these issues. Closes angular#11196
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug introduced in 1.4.0-beta.5: using ngMessagesInclude inside an ngRepeat (with ngForm - might be relevant) crashes with error:
See demo: http://plnkr.co/edit/9tEwZzf1q6qeUrL0rBxn?p=preview
Code is working fine in 1.3.14: http://plnkr.co/edit/yAuxsFGYymCj9fAAqTVw?p=preview
Crash does not occur if
msgs.html
is empty, it must have (any) content., i.e.:I'll paste the demo code here, too:
@matsko this is related to #10676 and matsko@d97733f
The text was updated successfully, but these errors were encountered: