Create Anular6 project – using below command ng new project_name Go to the project - project_name directory Create the user component – using below command ng g component user Create the user class export class User { public id : number ; public name : string ; public age : string ; public url ?: string } Create user component - user.component.ts import { Component , OnInit } from '@angular/core' ; import { HttpClient , HttpHeaders } from '@angular/common/http' ; import { FormBuilder , FormGroup , Validators } from '@angular/forms' ; import { User } from '../user; @ Component ({ selector: 'app-user' , templateUrl: './user.component.html' , styleUrls: [ './user.component.css' ] }) export class UserComponent implements OnInit { model = new User ();//user model object constructor () { } ngOnInit (...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers