My code is as shown below:
index.html
<!DOCTYPE html>
<html>
<head>
<title>quflip</title>
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/login.css">
</head>
<body ng-app="quflipMobWeb">
<ng-view></ng-view>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controller/loginController.js"></script>
<script src="js/controller/driverController.js"></script>
<script src="js/controller/driversController.js"></script>
</body>
</html>
app.js
angular.module('quflipMobWeb', [
'quflipMobWeb.services',
'quflipMobWeb.controllers',
'ngRoute'
]).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when("/drivers", { templateUrl: "template/drivers.html", controller: "driversController" }).
when("/drivers/:id", { templateUrl: "template/driver.html", controller: "driverController" }).
when("/login", { templateUrl: "template/login.html", controller: "loginController" }).
otherwise({ redirectTo: '/login' });
}]);
loginController.js
angular.module('quflipMobWeb.controllers', [])
.controller('loginController', function($scope) {
console.log("tested");
});
login.html
<div class="q-login-background">
<h3>It is website,enjoy it</h3>
</div>
app.css
/* app css stylesheet */
body {
width: 100vw;
height: 100vh;
}
login.css
.q-login-background {
width: 100vw;
height: 100vh;
/* background: url ("../img/ic_login.jpg") no-repeat; */
}
The moment I run it, it give me error:
Error: [ng:areq] Argument 'loginController' is not a function, got undefined. What am I missing here?
[]from this lineangular.module('quflipMobWeb.controllers', [])and try - Rakeschand[$injector:nomod] Module 'quflipMobWeb.controllers' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.andError: [ng:areq] Argument 'loginController' is not a function, got undefined- Mrugesh Thaker