You can use angular UIrouter for this.
look at this script, http://jsfiddle.net/thardy/eD3MU/ .
<div ui-view="main"></div>
angular.module('myApp', ['ui.state'])
.config(['$stateProvider', '$routeProvider',
function ($stateProvider, $routeProvider) {
$stateProvider
.state('test', {
abstract: true,
url: '/test',
views: {
'main': {
template: '<h1>Hello!!!</h1>' +
'<div ui-view="view1"></div>' +
'<div ui-view="view2"></div>'
}
}
})
.state('test.subs', {
url: '',
views: {
'view1@test': {
template: "Im View1"
},
'view2@test': {
template: "Im View2"
}
}
});
}])
.run(['$rootScope', '$state', '$stateParams', function ($rootScope, $state, $stateParams) {
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
$state.transitionTo('test.subs');
}]);
You can create basic views and subtasks in your application, for your application you can create basic views for login pages and the control panel, and then, if necessary, you can load subtitles on the page of your panel.
source
share