@demym wrote:
Hi,
i have an app based on sidemenus. Each page has the same left sidemenu and a specific right sidemenu, and my app.js is done in a similar way as under here:
indent preformatted text by 4 spaces
.state('app.homepage', { url: "/homepage", cache: false, views: { 'menuContent' :{ templateUrl: "homepage.html", controller: "HomepageCtrl" }, 'menuLeft' :{ templateUrl: "menu_left.html", controller: "HomepageCtrl" }, 'menuRight' :{ templateUrl: "menu_account.html", controller: "HomepageCtrl" } } }) .state('app.login', { url: "/login", views: { 'menuContent' :{ templateUrl: "login.html", controller: "LoginCtrl" } } })
.state('app.project', {
url: "/project/:projectid",
cache: false,
// params: { data: {} },
views: {
'menuContent' :{
templateUrl: "project.html",
controller: 'WfeCtrl'
},
'menuLeft' :{},
'menuRight' :{
templateUrl: "menu_project.html",
controller: "ProjectCtrl"
},
}So, some pages have a specific right side menu.
My problem is the following:in one page i have a refresh function (the page shows a list of objects); the refresh operation takes remote ajax data and then updates the $scope array that represents the list of objects. At the end of the $http call i have a $timeout function in which i effectively update the $scope var.
If i run the function from within the page (for example, putting a button inside that calls the refresh function) changes in data are displayed correctly (for example, if i delete one of the objects, it disappears from the page);
but, when i run the same function from the right sidemenu, the refresh function is executed, but changes in data are not displayed... i have verified that the $http gets actually called, and also that the returning json is correct... but the view does not refresh.....
this is the structure of my right sidemenu:
` <ion-content class="has-header"> <ion-list> <ion-item nav-clear menu-close ng-controller="ProjectsCtrl" ng-click="refreshProjects()"> <i class="icon ion-refresh"></i> Refresh </ion-item>`
The ProjectsCtrl controller is the correct one in which the refreshProjects function lives.
For now i'm using the refresh button inside the content of the page, but would like to use the right side menu for these kind of operations.
Hope i've explained well... Thanks in advance for you help
Posts: 7
Participants: 2