What is the default for controllerAs
for the Angular directive definition if it is not specified?
Asked
Active
Viewed 283 times
1
![](../../users/profiles/1113772.webp)
Paul Sweatte
- 22,871
- 7
- 116
- 244
![](../../users/profiles/722180.webp)
bjfletcher
- 9,975
- 3
- 44
- 64
-
possible duplicate of [How to check if a method argument of a directive is specified in AngularJS?](http://stackoverflow.com/questions/21935099/how-to-check-if-a-method-argument-of-a-directive-is-specified-in-angularjs) – Paul Sweatte Sep 17 '15 at 22:48
-
1@PaulSweatte What is the default then? :) – bjfletcher Sep 18 '15 at 14:15
-
[Unit tests](https://github.com/angular/angular.js/blob/master/test/ng/compileSpec.js) describe the behaviour as such: `it('should throw noident when missing controller identifier'` and `it('should throw noident when missing controllerAs directive property'` – Paul Sweatte Sep 18 '15 at 14:27
1 Answers
1
Unit tests describe the default behaviour of controllerAs
in the directive definition object(ddo) as such:
it('should throw noident when missing controller identifier')
it('should throw noident when missing controllerAs directive property')
References
![](../../users/profiles/1113772.webp)
Paul Sweatte
- 22,871
- 7
- 116
- 244
-
Interesting, I don't recall seeing any uncaught `noident`. Perhaps it was caught somewhere and handled discreetly? – bjfletcher Jan 29 '16 at 10:45