How to display json object parameters in angular 2 template typescript

后端 未结 1 958
死守一世寂寞
死守一世寂寞 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

    <h2>Welcome, {{ Users?.email }}</h2>
    
    0 讨论(0)
提交回复
热议问题