calculate after creatr
This commit is contained in:
parent
9ec4e43ecf
commit
fb175d66ff
|
|
@ -41,12 +41,13 @@ export class AssetCalculatorComponent implements OnInit, OnDestroy{
|
||||||
constructor(private assetService : AssetService ){
|
constructor(private assetService : AssetService ){
|
||||||
this.assetsDepreciationFormGroup.valueChanges.subscribe( (value) => this.calculate() );
|
this.assetsDepreciationFormGroup.valueChanges.subscribe( (value) => this.calculate() );
|
||||||
this.lifeFormArray.valueChanges.subscribe( (value) => this.calculate() );
|
this.lifeFormArray.valueChanges.subscribe( (value) => this.calculate() );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void{
|
ngOnInit(): void{
|
||||||
const savedAsset = localStorage.getItem('assetForCalculator');
|
const savedAsset = localStorage.getItem('assetForCalculator');
|
||||||
if (savedAsset) this.assetToControls(JSON.parse(savedAsset));
|
if (savedAsset) this.assetToControls(JSON.parse(savedAsset));
|
||||||
|
this.calculate();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue