Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

async in angular typescript

async initializeDepartmentList(): Promise<void> {
    const data: DepartmentModel[] = await this.userService.GetAllIndividualDepartment().toPromise();
    this.displayIndividualDepartmentList = data;
    this.currentDisplayDepartment = this.displayIndividualDepartmentList[0].department_id;
  }
  
  
  async ngOnInit(): Promise<void> {

    await this.initializeDepartmentList();
.
.
}
  
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #async #angular #typescript
ADD COMMENT
Topic
Name
8+1 =