javascript - Error: [$injector:unpr] and [$injector:nomod] when using angular js -


using angular js. when using code error, "uncaught error: [$injector:nomod] occur

 angular.module('app1') .provider('post',function(){  this.$get = ['$resource', function ($resource) {  var post = $resource('http'://localhost:7214/admn/university.aspx?/api/post/:_id', {}, { update: { method: 'put' } }) return post; }]; }); angular.module('app1') .controller('mainctrl', ['$scope', '$route', 'post', function ($scope,     $route, post) { $scope.post = new post(); $scope.posts = new post.query(); $scope.newpost = function () { $scope.post = new post(); $scope.editing = false; } 

and when add 'ngroute' in module error occurs, "error: [$injector:unpr] .the code error

angular.module('app1',['ngroute']) .provider('post',function(){ this.$get = ['$resource', function ($resource) { var post = $resource('http'://localhost:7214/admn/university.aspx?/api/post/:_id', {}, { update: { method: 'put' } }) return post; }]; }); angular.module('app1','[ngroute]') .controller('mainctrl', ['$scope', '$route', 'post', function ($scope,     $route, post) { $scope.post = new post(); $scope.posts = new post.query(); $scope.newpost = function () { $scope.post = new post(); $scope.editing = false; } 

here files included in project.

<script src="/scripts/jquery.js"></script> <script src="/scripts/angular.js"></script> <script src="/scripts/angular-ng-grid.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7    /angular-    resource.min.js"> </script> <script src="/scripts/angular-route.min.js"></script> 

note: in code above have used 'http:'then rest of link . because stackoverflow giving error of link. in project have use original pattern of linking.'http:/..../..'


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -