This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngMessages with bound message doesn't remove watch when message is removed #14307
Closed
Description
We have ngMessage texts which can change, and so are bound to model values rather than being hardcoded into the view.
eg.
<div ng-messages="form.input.$error">
<div ng-message="myError">{{errorMsg}}</div>
</div>
Every time the message is shown, it adds a new watch which is not removed when the message is removed, but stays added until the parent ng-messages element is destroyed.
JSFiddle showing the problem is available here https://jsfiddle.net/jwalkersl/Lumjd9tm/