Angular 2 - Displaying async Object data from promise

前端 未结 7 909
野性不改
野性不改 2020-12-02 22:57

Edit: It looks like my main problem now is that I can\'t seem to display async data from an object. I have a promise containing the data object, and when I use



        
7条回答
  •  囚心锁ツ
    2020-12-02 23:54

    I think you are making this too complex, and just need to do something like this.

    this.name = 
      this.stock.getStockData(this.ticker, http)
      .then( val => val.Name )
    

    and

    {{name.Name | async}}

提交回复
热议问题