0

I'm Call Multiple Functions To Load Data In One Page. I Use This To Call One Function on Page Load.

data-ng-init="fn_load()"

But I Want To Call More Functions Of Angularjs On Page Load.. How It Can Be Done?

2
  • 2
    like this data-ng-init="getAllProjects1();init();setMsgNotification();getUserById();setFlag()" Commented Mar 21, 2017 at 10:37
  • You might have more chances of getting an answer if you stop capitalising every word. Commented Mar 21, 2017 at 10:52

2 Answers 2

1

In your ng-init write a function called callAllFunctions

And write this in your controller

$scope.callAllFunctions = function(){

 getAllProjects1();
 init();
 setMsgNotification();‌​
 getUserById();
 setFla‌​g();

}
Sign up to request clarification or add additional context in comments.

Comments

0

I use initialisation stuff in Controller like,

var init = function()
{
 // declaring variables..

 // functions to load
 function1();
 $scope.function2();
}

init();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.