This commit updates the docs examples to be compatible with the `prefer-const` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143
15 lines
383 B
TypeScript
15 lines
383 B
TypeScript
import { Injectable } from '@angular/core';
|
|
|
|
import { TaxRateService } from './tax-rate.service';
|
|
|
|
@Injectable()
|
|
export class SalesTaxService {
|
|
constructor(private rateService: TaxRateService) { }
|
|
|
|
getVAT(value: string | number) {
|
|
const amount = (typeof value === 'string') ?
|
|
parseFloat(value) : value;
|
|
return (amount || 0) * this.rateService.getRate('VAT');
|
|
}
|
|
}
|