I am very new to Angularjs and this is my first try to build an app with it. I've following file loaded in my index.html file.
<!--Angularjs-->
<script src="assets/js/vendor/angular.min.js" type="text/javascript"></script>
<script src="assets/js/vendor/angular-route.min.js" type="text/javascript"></script>
<!--SleekDocketAppJS-->
<script src="app/app.module.js" type="text/javascript"></script>
<script src="app/app.route.js" type="text/javascript"></script>
<!--Controllers-->
<script src="app/components/dashboard/controller/dashboardController.js" type="text/javascript"></script>
<script src="app/components/product/controller/productController.js" type="text/javascript"></script>
His is my app.module.js file and I am trying to add a factory here name AuthFactory
'use strick';
var docket = angular.module("docket",['ngRoute']);
//Factory
docket.factory('AuthFactory',function(){
console.log('auth factory');
var authdata = {};
authdata.name = "user 1";
return (authdata);
});
//Running
docket.run(function(){
console.log("runing...");
});
This is my app.route.js file where I am calling my controllers based on route.
'use strict';
var docket = angular.module('docket');
docket.config(['$routeProvider',function($routeProvider){
$routeProvider
.when("/",
{
controller:"DashboardController",
templateUrl: "app/components/dashboard/view/dashboard.html"
})
.when("/product",{
controller:"productController",
templateUrl: "app/components/product/view/product.html"
})
.otherwise({
redirectTo:'/'
});
}]);
My simple dashboardController.js looks like this
var app = angular.module('docket');
app.controller('DashboardController',['$scope, AuthFactory', function($scope, AuthFactory){
console.log('dash controller');
//console.log(AuthFactory);
}]);
But when I am trying to run the app using loading the service DashboardController, I get his error. But if I remove the service from the controller dependency, there is no error.

use strickinapp.module.jsshould be corrected touse strict."$scope, AuthFactoryProvider". When you see any error switch to angular.js instead of angular.min.js so that you see more verbose error in the console.