This is simple

> angularApp.run([function () {
>       // Your JS Code
> }]);

where angularApp is an angular module.
Also you could have multiple runs.

But be aware of the calling order.
1. app.config()
2. app.run()
3. directive compile
4. app.controller()
5. directive link

> Run blocks - get executed after the injector is created and are used to 
> kickstart the application. Only instances and constants can be injected into 
> run blocks. This is to prevent further system configuration during application
> run time.



—
Best Regards

Christian Schmitt
[email protected]




Am 29.08.2014 um 15:26 schrieb Diego Lirio <[email protected]>:

> Hello, I would like to run an angular function to load the page. 
> But not creating an initial controller method as a constructor, but when you 
> run a specific page. 
> 
> Javascript for example would like this: <body onload = "myFunction ()">
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to