Chore: Check for deprecations using eslint plugin
Chore: environment file replacement stopped. Chore: All components are now standalone and removed all modules Chore: App routing is now in app.routes and similarly for all submodules Chore: Http interceptors are now functional and split refresh interceptor into a separate one.
This commit is contained in:
+24
-5
@@ -1,5 +1,10 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { MatCard, MatCardHeader, MatCardTitle, MatCardContent, MatCardActions } from '@angular/material/card';
|
||||
import { MatCheckbox } from '@angular/material/checkbox';
|
||||
import { MatFormField, MatLabel } from '@angular/material/form-field';
|
||||
import { MatInput } from '@angular/material/input';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { ProductGroup } from '../../core/product-group';
|
||||
@@ -10,6 +15,20 @@ import { ProductGroupService } from '../product-group.service';
|
||||
selector: 'app-product-group-detail',
|
||||
templateUrl: './product-group-detail.component.html',
|
||||
styleUrls: ['./product-group-detail.component.css'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
MatCard,
|
||||
MatCardHeader,
|
||||
MatCardTitle,
|
||||
MatCardContent,
|
||||
ReactiveFormsModule,
|
||||
MatFormField,
|
||||
MatLabel,
|
||||
MatInput,
|
||||
MatCheckbox,
|
||||
MatCardActions,
|
||||
MatButton,
|
||||
],
|
||||
})
|
||||
export class ProductGroupDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
@@ -60,15 +79,15 @@ export class ProductGroupDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
save() {
|
||||
this.ser.saveOrUpdate(this.getItem()).subscribe(
|
||||
() => {
|
||||
this.ser.saveOrUpdate(this.getItem()).subscribe({
|
||||
next: () => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/product-groups');
|
||||
},
|
||||
(error) => {
|
||||
error: (error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
getItem(): ProductGroup {
|
||||
|
||||
Reference in New Issue
Block a user