Created
July 2, 2017 12:01
-
-
Save Armenvardanyan95/7e01d9aba366a63d8dafa9ca1a5a8781 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: ` | |
| <div> | |
| <dropdown-component [options]="weightUnits"></dropdown-component> | |
| <input type="text" placeholder="Price"> | |
| <dropdown-component [options]="slashedWeightUnits"></dropdown-component> | |
| <-- Now this one's labels will be preceded with a slash --> | |
| </div> | |
| ` | |
| }) | |
| export class SomeComponent { | |
| public weightUnits = [{value: 1, label: 'kg'}, {value: 2, label: 'oz'}]; | |
| public slashedWeightUnits = [{value: 1, label: '/kg'}, {value: 2, label: '/oz'}]; | |
| // we just add a new property | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment