[英]how to change mobile-angular-ui “ui-state” from controller code
我保持如下狀態
<ui-state id='activeScreen' default='1'></ui-state>
我可以如下更改狀態
<a href="#" ui-set="{'activeScreen': 2}">click here</a>
如何從控制器代碼更改狀態?
您需要使用SharedState
服務:
app.controller('myController', function($scope, SharedState){
SharedState.initialize($scope, "activeScreen", 2);
});
要么:
app.controller('myController', function($scope, SharedState){
SharedState.set("activeScreen", 2);
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.