0

I'm running through the videos of angular js tutorial. and i'm having issue with creating a module.

the error that i get is:

Failed to instantiate module myalcoholist due to:
Error: [$injector:nomod] http://errors.angularjs.org/1.4.8/$injector/nomod?p0=myal...
at Error (native)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:6:416
at https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:24:186
at b (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:23:251)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:23:494
at https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:38:117
at n (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:7:333)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:37:488)
at eb (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:41:249)
at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js:19:463

my code is clean, all I have is the creation of the module.

this is the html:

<html ng-app="myalcoholist">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-MfvZlkHCEqatNoGiOXveE8FIwMzZg4W85qfrfIFBfYc= sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha256-Sk3nkD6mLTMOF0EOpNtsIry+s1CsaqQC1rVLTAy+0yc= sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
<script src="model/app.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>

and my model/app.js includes the following code:

(function(){
 var app = angular.module('myalcoholist',[]);
})

any ideas why i get this error ? any ideas regarding the issue would be greatly appreciated.

thanks

1 Answer 1

1

you define the function but did not call it. Try this

(function(){
 var app = angular.module('myalcoholist',[]);
})()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.