Skip to main content

Posts

Showing posts from January, 2018

Lifecyle hooks in Angular

Each Angular component goes through a lifecycle. This is managed by the Angular itself. Angular creates a component, renders it, creates and renders its children, looks for the changes in its data-bound properties and destroys it. Angular has lifecycle hooks for each such key moment and provide a way to act accordingly when such moment happens. Directive and component have a lifecycle. For each lifecycle moment, Angular provides a lifecycle hook . The developer can hook into such moment by implementing the one or more specific lifecycle interfaces from the Angular core. Angular provide following lifecycle hooks as under: ngOnChanges ngOnInit ngDoCheck ngAfterContentInit ngAfterContentChecked ngAfterContentInit ngAfterContentChecked ngOnDestroy   Sequence of execution of the lifecycle hooks During the creation of component: Constructor ngOnChanges ngOnInit ngDoCheck ngAfterContentInit ngAfterContentChecked ngAfterContentInit ngAfterContentChecked During chang...

Download Offline Version of Angular Documentation

This method is little tricky but it works. You only requires google chrome browser to download offline version of angular.io website. The steps are as follows: Open angular.io in chrome browser. Open all the pages at least once that you wanted to be available for offline reading. The pages will cached in browser. Now goto More tools > Add to Desktop and click add. Your offline version of angular.io is on desktop. Try it after disconnecting from the internet. Note: If you have not opened all the pages before step 3. There is no problem. Reconnect to internet and open all those links in the added shortcut on the desktop.