I have sample on Angular JS as:
angular.module('wm-admin', []). config(function($routeProvider) { $routeProvider. when('/users', {controller:UsersController, templateUrl:'/public/html/crm/users/list.html'}). otherwise({redirectTo:'/users'}); }); // Controllers // function UsersController($scope) { } It gives me error:
Uncaught Error: [$injector:modulerr] So, what I do wrong?
HTML:
<body ng-app="wm-admin"> </body> I tried also any code:
Angular JS:
(function (angular) { 'use strict'; angular.module('wm-admin', []) .config(function($routeProvider) { $routeProvider. when('/users', {controller:UsersController, templateUrl:'/public/html/crm/users/list.html'}). otherwise({redirectTo:'/users'}); }) // Controllers // .controller('UsersController', ['$scope', '$http', function ($scope, $http) { }]) })(window.angular); Look please code upper