Angular 4: Pocket Primer (Pocket Primer Series) by Oswald Campesato

Angular 4: Pocket Primer (Pocket Primer Series) by Oswald Campesato

Author:Oswald Campesato [Campesato, Oswald]
Language: eng
Format: azw3
Publisher: Mercury Learning and Information
Published: 2017-06-27T04:00:00+00:00


LISTING 5.9: user.component.ts

The contents of Listing 5.9 are straightforward: there is a User class comprising the fields fname and lname for the first name and last name, respectively, for each new user.

Finally, we need to update the contents of app.module.ts, as shown in Listing 5.10, where the modified contents are shown in bold.

LISTING 5.10: app.module.ts

As you can see, Listing 5.10 contains two new import statements so that the custom components MyPipe and User can be referenced in the declarations property.

Launch the application and after a few moments you will see the following in a browser session:

Complete List of Users:

Jane-Smith

John-Stone

Dave-Jones

Rick-Heard

Filtered List of Users:

Jane-Smith

John-Stone

Figure 5.2 displays the output from launching this Angular application and filtering based on the users whose first name starts with the capital letter J.



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.