gmostert / ng2-breadcrumb

This is an angular 2 component that creates a breadcrumb trail. It hooks into the angular2/router, to dynamically build up the crumb trail once a component is routed to.
MIT License
102 stars 81 forks source link

Callback function does not accept promises #99

Open ahelord opened 6 years ago

ahelord commented 6 years ago

I am trying to pass the parameter of the route to a promise to return the names of the clients but I do not succeed I have tried this

 async getNameForUser(id: string):string{
   const message = await this.getAsyncName("1");
   return message

  }

  public async getAsyncName(id: string): Promise<string> {

    const response = await this.userService.getUserByIdUser(+id)
    return response.first_name
  }