我调用多个函数在一个页面中加载数据。我用这个来调用页面加载上的一个函数。
data-ng-init="fn_load()"
但我想在页面加载上调用Angularjs的更多功能..如何完成?
答案 0 :(得分:1)
在ng-init中编写一个名为 callAllFunctions
的函数并在控制器中写下
$scope.callAllFunctions = function(){
getAllProjects1();
init();
setMsgNotification();
getUserById();
setFlag();
}
答案 1 :(得分:0)
我在Controller中使用初始化内容,
var init = function()
{
// declaring variables..
// functions to load
function1();
$scope.function2();
}
init();