When Angular renders the view before project
got a value assigned, it causes an exception. ?.
stops evaluating when project
is null
or undefined
, which usually happens when data is fetched async, for example from the server which can take quite some time.
The next time change detection recognizes a change, the bindings will be re-evaluated. When project
then has a value it will bind project.category
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…