raj247
raj247

Reputation: 401

Angular.js Uncaught Error: [$injector:modulerr]

<html>
<head>
    <title>Schedule Task</title>
    <meta charset="utf-8" />
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script> 
    <script src="Task.js"></script>
</head>
<body ng-app="TaskApp">
    <h1>Task</h1>
    <div>
        {{course}}
    </div>
</body>
</html>
========================================================
task.js
========================================================

(function () { 

    var app = angular.modules("TaskApp", []);

    app.controller("TaskController", function ($scope) {
        $scope.course = { "title": "AngularJS 101", "Description": "Awesome" };
    });

})();

I am getting these 2 errors:

1) Uncaught TypeError: angular.modules is not a function.

2) angular.min.js:35 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.3/$injector/modulerr?p0=TaskApp&p1=Error%3A…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.3%2Fangular.min.js%3A17%3A381).

I have tried all the solutions mentioned on different posts on stackoverflow. added () at the end, made an iffe, checked for typos in the namings but nothing seems to work. And also tried different versions of angular.

Upvotes: 3

Views: 1171

Answers (1)

clintsmith
clintsmith

Reputation: 685

angular.module

not

angular.modules

Upvotes: 3

Related Questions