diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-09-30 13:09:11 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-09-30 13:09:25 +0800 |
commit | 03faffe8da4c35f2807334489ba80eb562890d68 (patch) | |
tree | 89b41735f03824dd37e100f503afe824bfb74a24 | |
parent | ff6a0a2907a83c8057610195f0860f6ef4e6aa1c (diff) |
feat: optimize the code for the management page
Change-Id: I5475b377783ebef4a264b89f437eeebcb9bd60f8
Issue-ID: USECASEUI-307
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
-rw-r--r-- | usecaseui-portal/src/app/views/management/management.component.ts | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/usecaseui-portal/src/app/views/management/management.component.ts b/usecaseui-portal/src/app/views/management/management.component.ts index 8220a166..b1a88e1e 100644 --- a/usecaseui-portal/src/app/views/management/management.component.ts +++ b/usecaseui-portal/src/app/views/management/management.component.ts @@ -28,27 +28,21 @@ import { ManagemencsService } from '../../core/services/managemencs.service'; export class ManagementComponent implements OnInit { @HostBinding('@routerAnimate') routerAnimateState; //Routing animation + nocuster: boolean; + firstCustomer: string; + constructor(private managemencs: ManagemencsService) { } ngOnInit() { this.getAllCustomers(); } - - nocuster = true; - firstCustomer = null; - AllCustomersdata = []; - + // Get all customers getAllCustomers() { this.managemencs.getAllCustomers().subscribe((data) => { - if (data.length > 0) { - this.nocuster = false; - } else { - this.nocuster = true; - } + this.nocuster = data.length > 0 ? false : true; }) } - createNewCustomer(customer) { let createParams = { customerId: customer @@ -63,6 +57,6 @@ export class ManagementComponent implements OnInit { }) } clearCustomerInput() { - this.firstCustomer = null; + this.firstCustomer = ''; } } |