Angular 2 - Displaying async Object data from promise

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

    You do not need any special pipe. Angular 2 suppport optional field. You just need to add ? in your object

    {{ (data | async)?.name }}
    

    or

    {{(name | async)?}}
    

提交回复
热议问题