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 {UnpostedDataSource} from './unposted-datasource';
|
||||
import {Unposted} from './unposted';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {UnpostedService} from './unposted.service';
|
||||
import {map} from 'rxjs/operators';
|
||||
import { UnpostedDataSource } from './unposted-datasource';
|
||||
import { Unposted } from './unposted';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { UnpostedService } from './unposted.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'app-unposted',
|
||||
templateUrl: './unposted.component.html',
|
||||
styleUrls: ['./unposted.component.css']
|
||||
styleUrls: ['./unposted.component.css'],
|
||||
})
|
||||
export class UnpostedComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
@ -18,19 +18,30 @@ export class UnpostedComponent implements OnInit {
|
||||
dataSource: UnpostedDataSource;
|
||||
info: Unposted[];
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['date', 'voucherType', 'narration', 'debitName', 'debitAmount', 'creditName', 'creditAmount'];
|
||||
displayedColumns = [
|
||||
'date',
|
||||
'voucherType',
|
||||
'narration',
|
||||
'debitName',
|
||||
'debitAmount',
|
||||
'creditName',
|
||||
'creditAmount',
|
||||
];
|
||||
|
||||
constructor(private route: ActivatedRoute, private router: Router, private ser: UnpostedService) {
|
||||
}
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private ser: UnpostedService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { info: Unposted[] }) => {
|
||||
this.info = data.info;
|
||||
});
|
||||
this.info = data.info;
|
||||
});
|
||||
this.dataSource = new UnpostedDataSource(this.paginator, this.sort, this.info);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
this.ser.list().subscribe((info: Unposted[]) => this.info = info);
|
||||
this.ser.list().subscribe((info: Unposted[]) => (this.info = info));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user