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:
+21
-23
@@ -1,15 +1,15 @@
|
||||
import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
|
||||
import {ProductGroupService} from '../product-group.service';
|
||||
import {ProductGroup} from '../../core/product-group';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {ToasterService} from '../../core/toaster.service';
|
||||
import {FormBuilder, FormGroup} from '@angular/forms';
|
||||
import { ProductGroupService } from '../product-group.service';
|
||||
import { ProductGroup } from '../../core/product-group';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-product-group-detail',
|
||||
templateUrl: './product-group-detail.component.html',
|
||||
styleUrls: ['./product-group-detail.component.css']
|
||||
styleUrls: ['./product-group-detail.component.css'],
|
||||
})
|
||||
export class ProductGroupDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement: ElementRef;
|
||||
@@ -21,22 +21,21 @@ export class ProductGroupDetailComponent implements OnInit, AfterViewInit {
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: ProductGroupService
|
||||
private ser: ProductGroupService,
|
||||
) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
name: ''
|
||||
name: '',
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { item: ProductGroup }) => {
|
||||
this.showItem(data.item);
|
||||
});
|
||||
this.route.data.subscribe((data: { item: ProductGroup }) => {
|
||||
this.showItem(data.item);
|
||||
});
|
||||
}
|
||||
|
||||
showItem(item: ProductGroup) {
|
||||
@@ -53,16 +52,15 @@ export class ProductGroupDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
save() {
|
||||
this.ser.saveOrUpdate(this.getItem())
|
||||
.subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/product-groups');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
}
|
||||
);
|
||||
this.ser.saveOrUpdate(this.getItem()).subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/product-groups');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
getItem(): ProductGroup {
|
||||
|
||||
Reference in New Issue
Block a user