Moving to strict.
Create form has now moved to constructor and route data subscribe is type safe.
This commit is contained in:
1 parent
30b1a3ef7d
commit
39e3cc51bb
52 files changed
+348
-448
No files matched your search
@@ -26,10 +26,6 @@ export class ClientDetailComponent implements OnInit, AfterViewInit {
|
||||
private toaster: ToasterService,
|
||||
private ser: ClientService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
code: { value: '', disabled: true },
|
||||
name: '',
|
||||
@@ -39,7 +35,9 @@ export class ClientDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { item: Client }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { item: Client };
|
||||
|
||||
this.showItem(data.item);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,7 +23,9 @@ export class ClientListComponent implements OnInit {
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((data: { list: Client[] }) => {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: Client[] };
|
||||
|
||||
this.list = data.list;
|
||||
});
|
||||
this.dataSource = new ClientListDataSource(this.paginator, this.sort, this.list);
|
||||
|
||||
Reference in new issue
Block a user