Prettied, Linted and updated angular.json according to the latest schematic of Angular CLI.
Now all that is needed is to make it ready for strict compiling. Removed eslint-plugin-prettier as it is not recommended and causes errors for both eslint and prettier Bumped to v8.0.0
This commit is contained in:
@@ -3,17 +3,20 @@ import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { BehaviorSubject, Observable, of as observableOf } from 'rxjs';
|
||||
import { EmployeeAttendanceDataSource } from './employee-attendance-datasource';
|
||||
import * as moment from 'moment';
|
||||
import { BehaviorSubject, Observable, of as observableOf } from 'rxjs';
|
||||
import { debounceTime, distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators';
|
||||
|
||||
import { AttendanceType } from '../attendance/attendance-type';
|
||||
import { AuthService } from '../auth/auth.service';
|
||||
import { ToasterService } from '../core/toaster.service';
|
||||
import { EmployeeAttendanceService } from './employee-attendance.service';
|
||||
import { EmployeeAttendance, EmployeeAttendanceItem } from './employee-attendance';
|
||||
import { EmployeeService } from '../employee/employee.service';
|
||||
import { Employee } from '../employee/employee';
|
||||
import { debounceTime, distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators';
|
||||
import { AttendanceType } from '../attendance/attendance-type';
|
||||
import { EmployeeService } from '../employee/employee.service';
|
||||
|
||||
import { EmployeeAttendance } from './employee-attendance';
|
||||
import { EmployeeAttendanceDataSource } from './employee-attendance-datasource';
|
||||
import { EmployeeAttendanceItem } from './employee-attendance-item';
|
||||
import { EmployeeAttendanceService } from './employee-attendance.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-employee-attendance',
|
||||
@@ -107,7 +110,7 @@ export class EmployeeAttendanceComponent implements OnInit, AfterViewInit {
|
||||
getClass(index: number) {
|
||||
const array = this.form.get('attendances') as FormArray;
|
||||
const id = array.controls[index].value.attendanceType;
|
||||
const name: string = this.attendanceTypes.filter((x) => x.id === id)[0].name;
|
||||
const { name } = this.attendanceTypes.filter((x) => x.id === id)[0];
|
||||
return name.toLowerCase().replace(/(\s+\+\s+)|(\s+)/g, '-');
|
||||
}
|
||||
|
||||
@@ -125,7 +128,7 @@ export class EmployeeAttendanceComponent implements OnInit, AfterViewInit {
|
||||
|
||||
save() {
|
||||
this.ser.save(this.getEmployeeAttendance()).subscribe(
|
||||
(result) => {
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
},
|
||||
(error) => {
|
||||
|
||||
Reference in New Issue
Block a user