AngularJS Cannot read property ‘1’ of null error.

August 16, 2014
Reading Time: 1 minute

tl;dr Check your views for any empty directive tags, such as ng-controller=””.

When you’ve been using AngularJS long enough, you quickly realize that some of the error messages can be pretty cryptic. This one is no substitute:

Cannot read property '1' of null

Some of these errors will send you into an instant mental panic, thinking…what.did.i.just.do?!

I’m not sure of all of the cases that this error will appear, but for me it was because I left an ng-controller=”” empty in the html view. So if you get this error begin looking for any empty directives tags in your view(s).

Leave a Reply

Your email address will not be published. Required fields are marked *