How to display json object parameters in angular 2 template typescript

后端 未结 1 960
死守一世寂寞
死守一世寂寞 2021-01-16 10:36

I am trying to display Object in template . In console Users.email is working but in template its not working. Is it mandatory to define type of Users objec

1条回答
  •  孤街浪徒
    2021-01-16 10:58

    Your using Observables so the data will be little delay in time so you need to type safe opertaor ? as below

    Welcome, {{ Users?.email }}

    0 讨论(0)
提交回复
热议问题