Angular 2 - Displaying async Object data from promise

前端 未结 7 828
野性不改
野性不改 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

    <h2>{{name.Name | async}}</h2>
    
    0 讨论(0)
提交回复
热议问题