UNPKG

@rxap/life-cycle

Version:

Provides an Angular service and guard to manage application lifecycle. It allows to execute code when the application is stable and ready. Includes a guard to prevent route activation until the app is ready.

15 lines (12 loc) 311 B
var compodoc = { EVENTS: { READY: 'compodoc.ready', SEARCH_READY: 'compodoc.search.ready' } }; Object.assign( compodoc, EventDispatcher.prototype ); document.addEventListener('DOMContentLoaded', function() { compodoc.dispatchEvent({ type: compodoc.EVENTS.READY }); });