I'm doing an angular page as shown below, the datatable part belongs to ng-view(using ngRoute) and the navigation bar above belongs to index.html which is the parent. Also in the child view there is a navbar on the bottom. Now I want to put these two navbars together(move child navbar outside of ng-view). I've tried to put the child navbar into index.html, then ng-controller='childController' , it doesn't show anything.
=======
If I make some fixed data in the array then it can be displayed. But data which is generated dynamically in the child controller is not working
Here is part of my code
I put the child navbar in index.html, then add the child controller:
<ul ng-controller="imagesController" >
<li ng-repeat="y in subNav">{{y.name}}</li>
</ul>
<div><ng-view></ng-view></div>
in child controller, I push data to 'subNav' array which is used by ng-repeat
/*clicking folder in datatable*/
$scope.getInfo = function(index) {
if($scope.applicationimages[index].type == 'folder') {
$http({
method: 'GET',
url: $scope.url + '/' + $scope.applicationimages[index].name
}).then(function(response) {
$scope.subNav.push({name: $scope.applicationimages[index].name, suburl: $scope.url});
$scope.url += '/' + $scope.applicationimages[index].name;
$scope.applicationimages = response.data.payload.list;
}, function(response) {
console.log('http error');
})
}
}
/*child navigation bar*/
$scope.subNav = [];
$scope.getCurrentNav = function(index) {
$http({
method: 'GET',
url: $scope.subNav[index].suburl + '/' + $scope.subNav[index].name
}).then(function(response) {
$scope.subNav.splice(index+1);
$scope.applicationimages = response.data.payload.list;
$scope.url = $scope.subNav[index].suburl + '/' + $scope.subNav[index].name;
}, function(response) {
console.log('http error');
})
}