import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; @Component({ selector: 'ngx-customers-add-edit-two', templateUrl: './customers-add-edit-two.component.html', styleUrls: ['./customers-add-edit-two.component.scss'] }) export class CustomersAddEditTwoComponent implements OnInit { constructor( private router: Router ) { } admins =[{ name:'', email:'', password:'', password_confirmation:'' }]; ngOnInit() { } previous(){ this.router.navigate[('pages/register')]; } next(){ this.router.navigate[('pages/registerThree')]; } plusAdmin(){ this.admins.push({ name:'', email:'', password:'', password_confirmation:'' }); console.log('forms after plus' , this.admins); } onDeleteRow(index:number) { this.admins.splice(index , 1); console.log('files after delete ',this.admins); } }