I'm trying to build a simple app.
My index.html file
<!DOCTYPE html>
<html>
<head>
<script src="/bower_components/angular/angular.js"></script>
<script src="/bower_components/angular-route/angular-route.js"></script>
<script src="/js/main.js"></script>
<script src="/js/controllers/account.js"></script>
</head>
<body ng-app="elara">
wuuuu
<div ng-view></div>
</body>
</html>
main.js file
var app = angular.module('elara', [
'ngRoute'
]);
app.config(['$routeProvider',
function($routeProvider) {
debugger;
$routeProvider.
when('/', {
templateUrl: '/html/template/home-page.html',
controller: 'accountController'
}).
otherwise({
redirectTo: '/phones'
});
}]);
and my controller:
var app = angular.module('elara', []);
app.controller('accountController', ['$scope', '$http', function(){
$scope.username = "";
$scope.password = "";
$scope.register = function(){
$http.post(config.apiAddress + "account/login/", {username: $scope.username, password: $scope.password}).then(
function(data){
console.log(data);
}, function(response){
console.log(response);
});
};
}]);
please noitice the debugger in main.js file, but degugger is not stoping at that point. It's not looking like executing what's inside my app.config function. And when navigate to /
route, my home-page.html is not loaded into ng-view