-2
I have a method, carregarpagina();
that needs to be loaded as soon as the page is loaded. How do I do this on Angularjs.
-2
I have a method, carregarpagina();
that needs to be loaded as soon as the page is loaded. How do I do this on Angularjs.
1
You can simply perform the function at the end of the file
$scope.carregarPagina = function() { //implementação do metodo }
//...... seus outros métodos e atributos
$scope.carregarPagina();
Or use ngInit directive to assign a value when starting an attribute if necessary. https://docs.angularjs.org/api/ng/directive/ngInit
Browser other questions tagged javascript angularjs angular angularjs-directives ecmascript-5
You are not signed in. Login or sign up in order to post.