Skip to content

Instantly share code, notes, and snippets.

@rahulsahay19
Created September 17, 2017 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulsahay19/af6f5223a67ea31d1377fc3f582f8568 to your computer and use it in GitHub Desktop.
Save rahulsahay19/af6f5223a67ea31d1377fc3f582f8568 to your computer and use it in GitHub Desktop.
reviews
import {
Component,
OnInit,
Input,
OnChanges,
SimpleChanges,
DoCheck,
AfterContentInit,
AfterContentChecked,
AfterViewInit,
AfterViewChecked,
OnDestroy
} from '@angular/core';
import { Review,REVIEWS } from '../Models/Review';
import { LoggingService } from '../logging.service';
@Component({
selector: 'app-reviews',
templateUrl: './reviews.component.html',
styleUrls: ['./reviews.component.css'],
providers:[LoggingService]
})
export class ReviewsComponent implements
OnInit,
OnChanges,
DoCheck,
AfterContentInit,
AfterContentChecked,
AfterViewInit,
AfterViewChecked,
OnDestroy {
@Input('reviews') review: Review;
constructor(private loggingService:LoggingService) {
this.loggingService.logToConsole("Contstructor Called!");
}
ngOnInit() {
this.loggingService.logToConsole("ngOnInit Called!");
}
ngOnChanges(changes: SimpleChanges) {
this.loggingService.logToConsole("onChanges Called!");
}
ngDoCheck() {
this.loggingService.logToConsole("ngDoCheck Called!")
}
ngAfterContentInit(){
this.loggingService.logToConsole("ngAfterContentInit Called!")
}
ngAfterContentChecked() {
this.loggingService.logToConsole("ngAfterContentChecked Called!")
}
ngAfterViewInit() {
this.loggingService.logToConsole("ngAfterViewInit Called!");
}
ngAfterViewChecked() {
this.loggingService.logToConsole("ngAfterViewChecked Called!");
}
ngOnDestroy(): void {
this.loggingService.logToConsole("ngOnDestroy Called!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment