Couldn’t load template using templateUrl in Angularjs

The problem is that you are running your example off the file system (using the file:// protocol) and many browsers (Chrome, Opera) restricts XHR calls when using the file:// protocol. AngularJS templates are downloaded via XHR and this, combined with the usage of the file:// protocol results in the error you are getting.

You’ve got several options when it comes to resolving this situation:

Leave a Comment