Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

red-ant/angular-ra-pageload

Repository files navigation

angular-ra-pageload.js

ra.pageload module allows you to trigger an action after a page finishes loading, similar to listening for DOMContentLoaded event. Every time $location changes, the module waits for all $http requests to complete - including all API calls requested by your controllers and HTML partials requested by the ng-include directives in your views.

Getting started

Include ra.pageload as a dependency of your application.

angular.module('application', ['ra.pageload']);

Usage

When the page content is ready, $rootScope broadcasts pageload:ready event to its child scopes. Therefore, you can listen for it in your controller and perform additional actions.

angular.module('application')
  .controller('DemoCtrl', function($scope) {
    $scope.$on('pageload:ready', function() {
      // Do something
    });
  });

About

AngularJS service for triggering document ready event

Resources

Stars

Watchers

Forks

Packages

No packages published