Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (this.router.url.indexOf('edit') !== -1) {
- this.activatedRoute.params.subscribe(params => {
- this.quotesService.get(params['id'], quote => {
- this.clientControl.setValue(quote.client.name);
- this.projectNameControl.setValue(quote.projectName);
- this.divisionControl.setValue(quote.division.id);
- this.typeControl.setValue(quote.type);
- this.dateControl.setValue(quote.date);
- this.clientContactControl.setValue(quote.clientContact);
- this.regionControl.setValue(quote.region);
- this.priceControl.setValue(quote.price.toString().split('.')[0]);
- if ((quote.price.toString().split('.')[1]) === undefined) {
- this.centsControl.setValue('00');
- } else {
- this.centsControl.setValue(quote.price.toString().split('.')[1]);
- }
- this.commentsControl.setValue(quote.comments);
- this.followUpControl.setValue(quote.followUp);
- }, () => {
- this.snackbarService.showError('Une erreur est survenue. L\'opportunité demandée est introuvable.');
- this.router.navigate(['/opportunities/list']);
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement