I am Totally new to angular js, Little bit difficult to understand the routing concept in the angular js.
I am developing admin site. I need to structure like following.
I've Login.html = this is separate page, instead of partial Signup.html = This is also separate page, instead of partial After success login, it'll go to dashboard where I'll load all my partials using ng-view.
How could I do that ? I googled it. I can only see all like only for partial views.
I did like following, but not working. I knew this is wrong, but don't know how to do
Project:
app.js
var nApp = angular.module('nApp', ['ngRoute']);
nApp .config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/Login', {
templateUrl: 'App/Login/Login.html',
controller: 'LoginController',
caseInsensitiveMatch:true
}).when('/Signup', {
templateUrl: 'App/Signup/Signup.html',
controller: 'SignupController',
caseInsensitiveMatch:true
}).when('/Dashboard', {
templateUrl: 'App/Index.html',
controller: 'DashboardController',
caseInsensitiveMatch:true
})
.otherwise({
redirectTo: '/Login'
});
}]);
Login.html
<html ng-app="nApp">
<head></head>
<body></body>
</html>
Signup.html
<html ng-app="nApp">
<head></head>
<body></body>
</html>
Index.html
<html ng-app="nApp">
<head></head>
<body>
<div ng-view></div>
</body>
</html>
Placed app.js under App directory \ Is there any other way to do that please mention ...