TypeScript 2 for Angular Developers by Christian Nwamba

TypeScript 2 for Angular Developers by Christian Nwamba

Author:Christian Nwamba
Language: eng
Format: epub
Publisher: Packt
Published: 2017-12-06T10:27:16+00:00


Data in components

To better understand the importance of services and DI, let's create a simple app with a component that shows a list of user comments. Once you have an app created, you can run the following command to generate the required component:

ng g component comment-list

Update the component's code with the following snippet:

import { Component, OnInit } from '@angular/core';

@Component({

selector: 'app-comment-list',

templateUrl: './comment-list.component.html',

styleUrls: ['./comment-list.component.css']

})

export class CommentListComponent implements OnInit {



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.