View reviews.component.ts
import {
Component,
OnInit,
Input,
OnChanges,
SimpleChanges,
DoCheck,
AfterContentInit,
AfterContentChecked,
AfterViewInit,
View movies.component.ts
import {
Component,
OnInit,
EventEmitter,
Output,
ViewEncapsulation,
ViewChild,
ElementRef,
DoCheck,
OnDestroy,
View LoggingService.ts
import { Injectable } from '@angular/core';
@Injectable()
export class LoggingService {
constructor() { }
logToConsole(mesg:string){
console.log(mesg);
}
}
View polyfills.ts
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
View movies.component.ts
import {
Component,
OnInit,
EventEmitter,
Output,
ViewEncapsulation,
ViewChild,
ElementRef,
DoCheck,
OnDestroy,
View movies.component.html
<div class="container">
<h2>Total no of Movies:- {{moviesColl.length}} </h2>
<div class="row>" *ngFor="let movie of moviesColl">
<h4>Movie Name:- {{movie.name}} ,Director:- {{movie.directorName}}, Release Year:-{{movie.releaseYear}} </h4>
</div>
<hr>
<h3>Total Reviews: </h3>
<div class="row">
View reviews.component.ts
import {
Component,
OnInit,
Input,
OnChanges,
SimpleChanges,
DoCheck,
AfterContentInit,
AfterContentChecked,
AfterViewInit,
View reviews.component.ts
import {
Component,
OnInit,
Input,
OnChanges,
SimpleChanges,
DoCheck,
AfterContentInit,
AfterContentChecked
} from '@angular/core';
View reviews.component.ts
import {
Component,
OnInit,
Input,
OnChanges,
SimpleChanges,
DoCheck,
AfterContentInit
} from '@angular/core';
import { Review,REVIEWS } from '../Models/Review';
View Review.ts
export class Review {
reviewer: string;
comments:string;
}
export const REVIEWS = [
{reviewer: 'Rahul', comments:'Awesome Movie!'},
// {reviewer: 'Rohit', comments:'OK!'},
// {reviewer: 'Mohit', comments:'Not so great!'},