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
employee.component.html
Employee Id | First Name | Last Name | Department | City | 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started