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 { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import {BalanceSheetDataSource} from './balance-sheet-datasource';
|
||||
import {BalanceSheet} from './balance-sheet';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import { BalanceSheetDataSource } from './balance-sheet-datasource';
|
||||
import { BalanceSheet } from './balance-sheet';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import {FormBuilder, FormGroup} from '@angular/forms';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-balance-sheet',
|
||||
templateUrl: './balance-sheet.component.html',
|
||||
styleUrls: ['./balance-sheet.component.css']
|
||||
styleUrls: ['./balance-sheet.component.css'],
|
||||
})
|
||||
export class BalanceSheetComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
@ -27,18 +27,17 @@ export class BalanceSheetComponent implements OnInit {
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
date: ''
|
||||
date: '',
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { info: BalanceSheet }) => {
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
date: moment(this.info.date, 'DD-MMM-YYYY').toDate()
|
||||
});
|
||||
this.route.data.subscribe((data: { info: BalanceSheet }) => {
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
date: moment(this.info.date, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
});
|
||||
this.dataSource = new BalanceSheetDataSource(this.paginator, this.sort, this.info.body);
|
||||
}
|
||||
|
||||
@ -49,6 +48,6 @@ export class BalanceSheetComponent implements OnInit {
|
||||
|
||||
getDate(): string {
|
||||
const formModel = this.form.value;
|
||||
return moment(formModel.date).format('DD-MMM-YYYY');
|
||||
return moment(formModel.date).format('DD-MMM-YYYY');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user