【发布时间】:2017-02-25 18:18:34
【问题描述】:
我有一个功能
state('showList', {
url: '/listView',
templateUrl: 'app/templates/showlist.html',
controller: "showListCtrl"
}).
我的控制器,
.controller('overViewCtrl', function ($scope) {
$scope.getList = function(){
//A http call
}
});
当我的路由更改为“/listView”时,会调用 overView 控制器,但不会调用函数 getList(),但是当我刷新页面时会调用我。谁能帮帮我。我只是想调用它在控制器加载的那一刻起作用。谢谢。
当我的路线更改为“/listview”时
【问题讨论】:
标签: javascript angularjs controller mean-stack angularjs-routing