Created
June 25, 2017 09:40
-
-
Save Armenvardanyan95/572100dfb99bb1c983b68970c3170a49 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.label" /> | |
| <span> {{ user.fullName }} </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