Is this a bug or is there documentation somewhere that says not to use the suffix "start" in the name of a directive? Only the 'finish' directive works.
HTML:
<html ng-app="myApp">
...
<body>
<h2>Angular doesn't like the suffix 'start'</h2>
<div this-is-the-start="abc"></div>
<div this-is-the-finish="abc"></div>
</body>
...
</html>
JS:
var myApp = angular.module('myApp',[]);
myApp.directive('thisIsTheFinish', function() {
return {
restrict: 'A',
template: 'finish'
}
});
myApp.directive('thisIsTheStart', function() {
return {
restrict: 'A',
template: 'start'
}
});
Code in action: http://plnkr.co/edit/SrNncw?p=preview
I'm posting this answer so you can mark this question answered.
As @calebboyd pointed out, this was raised as an issue in GitHub and closed when a note about the breaking change was added to the release notes of "1.2.0rc1 spooky-giraffe (2013-08-13)". It's the last point under $compile in Breaking Changes:
- due to e46100f7, existing directives with name ending with "-start" or "-end" will stop working.
This change was necessary to enable multi-element directives. The best fix is to rename existing directives, so that they don't end with these suffixes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With