Skip to content

Instantly share code, notes, and snippets.

@Armenvardanyan95
Created July 2, 2017 12:01
Show Gist options
  • Save Armenvardanyan95/7e01d9aba366a63d8dafa9ca1a5a8781 to your computer and use it in GitHub Desktop.
Save Armenvardanyan95/7e01d9aba366a63d8dafa9ca1a5a8781 to your computer and use it in GitHub Desktop.
@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