I am trying to evaluate the below in template syntax which is an array:
FAIL {{ cols.length }}
I get the below error.
platfo
Use
{{ cols?.length }}
Or
{{ cols.length }}
If you want to print 0 for empty array, use
{{ cols?.length || '0' }}
Reason: cols is not initiated when Angular2 load the template. And we want to wait until it's ready to access its members.
cols