Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
data-ng-init="getAllProjects1();init();setMsgNotification();getUserById();setFlag()"
In your ng-init write a function called callAllFunctions
And write this in your controller
$scope.callAllFunctions = function(){ getAllProjects1(); init(); setMsgNotification(); getUserById(); setFlag(); }
Add a comment
I use initialisation stuff in Controller like,
var init = function() { // declaring variables.. // functions to load function1(); $scope.function2(); } init();
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
data-ng-init="getAllProjects1();init();setMsgNotification();getUserById();setFlag()"