In one of my applications, I have created a maincontroller and a main page with ui-view
. A main_live_video_chat.html
is being loaded into the main page ui-view
. This subpage main_live_video_chat.html has multiple ui-view
with controllers. I have created routes based on different states, these sub ui views works when part of main page, but shows nothing when configured with the sub page main_live_video_chat.html.
The app.config looks as follows:
app.config([
'$locationProvider',
'$stateProvider',
function($locationProvider, $stateProvider) {
//setup our two states, archive and live
$stateProvider
.state('player', {
abstract: true,
url: "/",
views: {
'': {templateUrl: "views/main.html",
controller: "mainController",
controllerAs: "main"
},
//******This config work fine.******
'schedule@player': {
templateUrl: "views/rail/schedule.html",
controller: "scheduleController",
controllerAs: "schedule"
}
}
})
.state('player.live', {
url: "^/live/:playerId",
templateUrl: "views/main_live_video_chat.html"
//******This config doesnt work.******
//views: {
// '@': {
// templateUrl: "views/main_live_video_chat.html",
// },
// 'schedule@player': {
// templateUrl: "views/rail/schedule.html",
// controller: "scheduleController",
// controllerAs: "schedule"
// },
})
}
]);
Please note that this schedule view need to be shown in vi view inside main_live_video_chat.html