Run function after loading page with Angularjs

Asked

Viewed 950 times

1

I am trying to execute a function that gives an alert on the screen after the however is loaded, however, I am not having success with ng-init because using ng-init it gives the alert and the screen is empty and only presses after clicking the 'OK' button. There is a way to execute a function only after ng-view content has been loaded ?

1 answer

1

According to the documentation:

$scope.$on('$viewContentLoaded', function(){
    //Executar depois de carregado
});
  • Also failed, I ended up 'solving' with the $timeout, but thanks for the help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.