【发布时间】:2015-07-09 13:24:19
【问题描述】:
unified.controller('YourteamController', function uniYourteamController($scope) {
testController.listTeams();
});
unified.controller('testController', function testController($scope) {
$scope.listTeams = function() {
//Listing process
};
});
我有两个控制器。我需要在另一个控制器(testController)中调用一个函数(listTeams())。如何使用 angularjs 调用它
【问题讨论】:
-
我认为您正在寻找 $rootScope ....
-
你的意思是从控制器 2 调用控制器 1 中的函数?
-
是的,我需要在第二个控制器中调用一个函数。 @ngLover
标签: angularjs angularjs-directive angularjs-scope