AngularJS Components
Learn Components in AngularJS-14 The main purpose of Angular Component is to generate a part of web page called view, with the help of template. In this tutorial, you will learn how to work with component and template. Create a component: Create Component from CLI create two components C: \ >ng4app> ng g c components/user ng angular command g ( generate) c (component) Result: The output is as show below − CREATE src/app/user/user.component.html (28 bytes) CREATE src/app/user/user.component.spec.ts (671 bytes) CREATE src/app/user/user.component.ts (296 bytes) CREATE src/app/user/user.component.css (0 bytes) UPDATE src/app/app.module.ts (431 bytes) Here, UserComponent is created under src/app/user folder. Component class, Template and stylesheet are created. AppModule is updated with new component. // src/app/user.component.ts import { Component, OnInit } from '@angular/core' ; ...