Created
June 25, 2017 09:41
-
-
Save Armenvardanyan95/bb86fa01defd2f77982e636c99a1df3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Component({ | |
| selector: 'some-component', | |
| template: ` | |
| <p-dropDown [options]="users"> | |
| <ng-template let-user> //now we have a local 'user' variable with each user's data | |
| <img [src]="user.avatar" /> | |
| <span> {{ user.label }} </span> | |
| </ng-template> | |
| </p-dropDown> | |
| ` | |
| }) | |
| class SomeComponent { | |
| users: SelectItem[] = [ | |
| {value: 1, label: 'Armen Vardanyan', avatar: 'link-to-image.jpg'}, | |
| {value: 2, label: 'Also Armen Vardanyan', avatar: 'link-to-image.jpg'} | |
| ]; | |
| /* | |
| We can add an avatar to | |
| SelectItem interface | |
| */ | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment