I just started working with angular after reading the docs. I'm still a newbie.
Calling arrays in angular2 is simple:
you just have to use *ngfor item of items and then {{item.name}}.
what if I'm calling a single object, string or any, from my ts file . How can I do that?
I tried :
{{myvariable}}
or
<div ng-init="let x = myvariable"> {{x.name}}</div>
and other stuff but it doesn't work. Thanks in advance.
{{myvariable.id}} {{myvariable.name}}
or if the variable is not initialized yet when the component is created.
{{myvariable?.id}} {{myvariable?.name}}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments