angular/angular.js — pull request #5372 by caitp (2013-12-11 21:00:18+00:00)
Title: Multi-element directives should explicitly declare themselves as being multi-element

With regards to https://github.com/angular/angular.js/issues/5370, I think it's a bit crazy to completely disable the use of attributes/directives ending with `-start` or `-end`.

I would propose something like this:

```
angular.module('blah', [])
.directive('multiElementDir', function() {
return {
multiElement: true, // Explicit declaration
// ...
};
});
```

And, instead of this:

```js
var directiveNName = ngAttrName.replace(/(Start|End)$/, '');
if (ngAttrName === directiveNName + 'Start') {
attrStartName = name;
attrEndName = name.substr(0, name.length - 5) + 'end';
name = name.substr(0, name.length - 6);
}
```

we could have something like

```js
var directiveNName = ngAttrName.replace(/(Start|End)$/, '');
if (hasDirectives.hasOwnProperty(directiveNName) && hasDirectives[directiveNName].multiElement) {
// Only worry about start/end names if directive is explicitly multiElement
if (ngAttrName === directiveNName + 'Start') {
attrStartName = name;
attrEndName = name.substr(0, name.length - 5) + 'end';
name = name.substr(0, name.length - 6);
}
}
```

then we could allow both multi-element attributes and attributes ending with `-start` and `-end`, which I think would be nice.