Check out my code on Plunker where I have implemented these routes.
'use strict';
var app = angular.module('app', ['ngResource', 'ui.router','ngAnimate', 'ui.bootstrap'])
.controller('Ctrl',function($scope,$log){
// controller code....
})
.config(['$urlRouterProvider','$stateProvider',function($urlRouterProvider,$stateProvider) {
$urlRouterProvider.otherwise('/login');
$stateProvider
.state('home', {
url:'/home',
templateUrl: '/views/home_page.html',
resolve: {
loggedin: checkLoggedin
}
})
.state('admin', {
url:'/admin',
templateUrl: 'views/admin.html',
resolve: {
loggedin: checkLoggedin
}
})
.state('login', {
url:'/login',
templateUrl: 'views/login.html',
});
}]) // end of config()
I'm encountering an issue with routing. I've created a login.html file, and after successfully logging in, the redirection to home_page.html works fine. However, when navigating to the admin page from the home page, only the admin content is displayed without the navigation bar. Even though I'm using ui-view in index.html, the navigation bar from the home page is not visible on other pages. If I place the navigation bar code in index.html, it will be displayed even on the login screen, which is not desired. Can someone assist me in resolving this issue?