Moved from tslint to eslint as tslint was depreciated.
Added prettier and also prettied all the typescript files using prettier ESLint is using the AirBnB rules which are the most strict to lint the files.
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {FormBuilder, FormGroup} from '@angular/forms';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import {PurchasesDataSource} from './purchases-datasource';
|
||||
import {Purchases, PurchasesItem} from './purchases';
|
||||
import { PurchasesDataSource } from './purchases-datasource';
|
||||
import { Purchases, PurchasesItem } from './purchases';
|
||||
|
||||
@Component({
|
||||
selector: 'app-purchases',
|
||||
templateUrl: './purchases.component.html',
|
||||
styleUrls: ['./purchases.component.css']
|
||||
styleUrls: ['./purchases.component.css'],
|
||||
})
|
||||
export class PurchasesComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
@@ -22,24 +22,19 @@ export class PurchasesComponent implements OnInit {
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['product', 'quantity', 'rate', 'amount'];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder
|
||||
) {
|
||||
constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { info: Purchases }) => {
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate()
|
||||
});
|
||||
this.dataSource = new PurchasesDataSource(this.paginator, this.sort, this.info.body);
|
||||
this.route.data.subscribe((data: { info: Purchases }) => {
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
this.dataSource = new PurchasesDataSource(this.paginator, this.sort, this.info.body);
|
||||
});
|
||||
}
|
||||
|
||||
show() {
|
||||
@@ -47,8 +42,8 @@ export class PurchasesComponent implements OnInit {
|
||||
this.router.navigate(['purchases'], {
|
||||
queryParams: {
|
||||
startDate: l.startDate,
|
||||
finishDate: l.finishDate
|
||||
}
|
||||
finishDate: l.finishDate,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -66,7 +61,7 @@ export class PurchasesComponent implements OnInit {
|
||||
startDate: moment(formModel.startDate).format('DD-MMM-YYYY'),
|
||||
finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'),
|
||||
body: [],
|
||||
footer: new PurchasesItem()
|
||||
footer: new PurchasesItem(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user