Question: Angula--I have this code working properly but I need to get it print in the console every time Update the FIle ? Code: Index.Html :

Angula--I have this code working properly but I need to get it print in the console every time Update the FIle ?

Code:

Index.Html : Add bootstrap file path

EmployeeList

employee.component.html

Employee Id First Name Last Name Department City Email Edit Update

employee.component.ts

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

import { EmployeeData } from './employee'

@Component({

selector: 'app-employee',

templateUrl: './employee.component.html',

styleUrls: ['./employee.component.css']

})

export class EmployeeComponent implements OnInit {

enable : null;

employeeData : EmployeeData[] = [{

'employee_Id' : 1,

'first_Name' : 'john',

'last_Name' : 'robort',

'department' : 'Banking',

'city' : 'Delhi',

'email' : 'john.robort@gm@il.com'

},

{

'employee_Id' : 2,

'first_Name' : 'nick',

'last_Name' : 'fury',

'department' : 'Manager',

'city' : 'Hydrabad',

'email' : 'nick.fury@gm@il.com'

}];

constructor() { }

ngOnInit(): void {

}

editEmployee(indexValue){

this.enable = indexValue;

}

updateEmployee(indexValue,employee){

this.employeeData[indexValue].employee_Id = employee.employee_Id;

this.employeeData[indexValue].first_Name = employee.first_Name;

this.employeeData[indexValue].last_Name = employee.last_Name;

this.employeeData[indexValue].department = employee.department;

this.employeeData[indexValue].city = employee.city;

this.employeeData[indexValue].email = employee.email;

this.enable = null;

}

}

employee.ts

export interface EmployeeData{

employee_Id : number;

first_Name : string;

last_Name : string;

department : string;

city : string;

email : string;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!