I've got a simple angular.js app with two views: /login & /register. My index.html looks this way:
...
<body>
<ul class="menu">
<li><a href="#/login">Login</a></li>
<li><a href="#/register">Register</a></li>
</ul>
<div ng-view></div>
...(javascript inclusions)...
app.js
var adventureApp = angular.module('ownAdventure', [
'ngRoute',
'ngCookies',
'Login',
'Register'
]);
adventureApp.config(['$routeProvider', '$locationProvider',
function ($routeProvider){
$routeProvider
.when('/login', {
controller: 'LoginController',
templateUrl: '/login/login.view.html'
})
.when('/register', {
controller: 'RegisterController',
templateUrl: '/register/register.view.html'
})
.otherwise({ redirectTo: '/login' });
}]);
I've got both Login and Register modules in sepparate .js files, and added the LoginController and RegisterController accordingly in both files exactly the same.
login.controller.js (same with register):
'use strict';
var loginController = angular.module('Login', ['ngRoute', 'ngCookies']);
loginController.controller('LoginController', ['$scope',
function($scope) {
$scope.test = 'This is a simple test';
}]);
Both login/ and register/ folders are inside the app/ folder at the same level as app.js, therefore I cannot figure out why I constantly get the following error message: GET http://localhost:8000/login/login.view.html 404 (Not Found)
Thank you in advance.