I am currently in the process of migrating my app from Angular 1.2 to 1.3 and I am encountering an issue with the different behaviors of the removeControl and addControl functions.
Within my directive, I have implemented a functionality that escapes registered elements in a form (for specific reasons).
<div name="es.caped" ng-model="es.caped" esc-dir></div>
link: function link($scope, $element, $attrs, $ctrl) {
var nameAttr = $attrs.name.replace(/([ #;?&,.+*~\':"!^$[\]()=>|\/@\{\}])/g, '\\$1');
$ctrl[1].$removeControl($ctrl[0]);
$ctrl[0].$name = nameAttr;
$ctrl[1].$addControl($ctrl[0]);
}
After migrating to Angular 1.3, I noticed that the output changed from {"es\\.caped":{}}
in 1.2 to {"es.caped":{}}
in 1.3.
For more information and examples of the behavior, please refer to the following Plunker links:
1.2 version - Plunker 1.2 version
1.3 version - Plunker 1.3 version
The Plunker will display the JSON output for comparison.
I have extensively searched through the documentation for versions 1.2 and 1.3, but could not find a solution. However, in version 1.5, I came across the following note:
Despite spending numerous hours trying to resolve this issue, I have not been successful in propagating the changes. Any guidance or assistance would be greatly appreciated.
Note: I have also tested this behavior with Angular 1.4 and 1.5, both exhibiting the same behavior as 1.3. My ultimate goal is to complete the migration to version 1.5 while following the migration guide step by step.