Why is AngularJS $route not working, pasted directly from the documentation? -
so wanting learn more how use angularjs $route seems way go single page application. naturally, best place start documentation. have nice little plunker me visually , hands-on see how works. next up, playing , making own. before can start messing make own though, need working outside plunker: so made copies of each file , put them in same directory.
however, getting following errors:
typeerror: angular undefined script.js:3:0
referenceerror: angular not defined index.html:14:4
the line first error is:
angular.element(document.getelementsbytagname('head')).append(angular.element('<base href="' + window.location.pathname + '" />'));
and line second error is:
angular.module('ngrouteexample', ['ngroute'])
so me obvious not registering angularjs referenced or something. nothing code breaking, doesn't recognize angularjs. why this? how fix this?
have @ angular documentation here. make sure have included angular library in index.html (or index.jsp/index.aspx).
<!doctype html> <html ng-app> <head> <title>my angular app</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> </head> <body> </body> </html>
Comments
Post a Comment