Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript AngularJS Basics (1.x) Getting Started with Angular Your First Angular Directive

uday padakanti
uday padakanti
734 Points

After following the instructions by the instructor and executing the code in work space shows errors.

App.js: anglular.module("todoListApp",[]);

hello-world.js: angular.module('todoListApp') .directive('helloWorld', function(){ return{ template: "This is the hello world directive!" }; });

index.html:

<!doctype html> <html lang="en"> <head> <title></title> <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'> <link href='styles/main.css' rel='stylesheet' type='text/css'> </head> <body ng-app="todoListApp"> <hello-world></hello-world> <script src= "vendor/angular.js" type="text/javascript"></script> <script src= "scripts/app.js" type="text/javascript"></script> <script src= "scripts/hello-world.js" type="text/javascript"></script>

</body> </html>

Error: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. app.js:1 Uncaught ReferenceError: anglular is not defined(anonymous function) @ app.js:1 angular.js:68 Uncaught Error: [$injector:nomod] Module 'todoListApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.4.4/$injector/nomod?p0=todoListApp(anonymous function) @ angular.js:68(anonymous function) @ angular.js:1983ensure @ angular.js:1907module @ angular.js:1981(anonymous function) @ hello-world.js:1 angular.js:68 Uncaught Error: [$injector:modulerr] Failed to instantiate module todoListApp due to: Error: [$injector:nomod] Module 'todoListApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.4.4/$injector/nomod?p0=todoListApp at http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:68:12 at http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:1983:17 at ensure (http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:1907:38) at module (http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:1981:14) at http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:4385:22 at forEach (http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:336:20) at loadModules (http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:4369:5) at createInjector (http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:4294:11) at doBootstrap (http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:1655:20) at bootstrap (http://port-80-auj1iww6be.treehouse-app.com/vendor/angular.js:1676:12) http://errors.angularjs.org/1.4.4/$injector/modulerr?p0=todoListApp&p1=Erro…F%2Fport-80-auj1iww6be.treehouse-app.com%2Fvendor%2Fangular.js%3A1676%3A12)(anonymous function) @ angular.js:68(anonymous function) @ angular.js:4408forEach @ angular.js:336loadModules @ angular.js:4369createInjector @ angular.js:4294doBootstrap @ angular.js:1655bootstrap @ angular.js:1676angularInit @ angular.js:1570(anonymous function) @ angular.js:28599trigger @ angular.js:3018eventHandler @ angular.js:3293

1 Answer