Chore:
Moved to Angular 16 Moved to FastAPI 0.100.0 Moved to pydantic 2.0
This commit is contained in:
@ -39,7 +39,7 @@
|
||||
<mat-label>Discount on {{ r.name }}</mat-label>
|
||||
<input matInput formControlName="discount" />
|
||||
<span matSuffix>%</span>
|
||||
<mat-hint>Max {{ r.limit | percent : '1.2-2' }}</mat-hint>
|
||||
<mat-hint>Max {{ r.limit | percent: '1.2-2' }}</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Customer } from '../core/customer';
|
||||
@ -9,7 +8,7 @@ import { CustomerService } from './customer.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CustomerListResolver implements Resolve<Customer[]> {
|
||||
export class CustomerListResolver {
|
||||
constructor(private ser: CustomerService) {}
|
||||
|
||||
resolve(): Observable<Customer[]> {
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<mat-cell *matCellDef="let row">
|
||||
<ul>
|
||||
<li *ngFor="let discount of row.discounts">
|
||||
{{ discount.name }} - {{ discount.discount | percent : '1.2-2' }}
|
||||
{{ discount.name }} - {{ discount.discount | percent: '1.2-2' }}
|
||||
</li>
|
||||
</ul>
|
||||
</mat-cell>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
import { ActivatedRouteSnapshot } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Customer } from '../core/customer';
|
||||
@ -9,7 +9,7 @@ import { CustomerService } from './customer.service';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CustomerResolver implements Resolve<Customer> {
|
||||
export class CustomerResolver {
|
||||
constructor(private ser: CustomerService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<Customer> {
|
||||
|
||||
@ -16,7 +16,10 @@ const serviceName = 'CustomerService';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CustomerService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private log: ErrorLoggerService,
|
||||
) {}
|
||||
|
||||
get(id: string | null): Observable<Customer> {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
|
||||
Reference in New Issue
Block a user