If you really need the data to be loaded right after start, regardless of 
any controller/scope, then you can use

angular.run(function ($http) {
   $http({method: 'GET', url: '/someUrl'})
      .success(function(data, status, headers, config) {
          ...
       });
})

Still it's probably better to have a service that loads and stores the data 
and inject the service where needed.

On Monday, January 27, 2014 2:51:12 PM UTC+1, biloki wrote:
>
> Hi everyone, I want to load data by ajax in my app after html is loaded. 
>
> Normally with jquery I do like that $(function() { // Handler for .ready() 
> called. }); 
>
> or window.onload with the pure javascript. 
>
> But I don't see in the angular doc that talks about this function. 
>
> Someone can help me how to do with angularjs Thank you
>

-- 
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/groups/opt_out.

Reply via email to