In angular 2, when I want to style a specific component I use the following:
<div #mask id="mask" class="col-xs-12 some-generi-ccss-class"></div>
// in .css
#mask{
height: 50px;
}
In my opinion it seems like a bit of a double handle defining both an id (id="mask"
) to style with and a ng2 selector string (#mask
) to use with @ViewChild('mask')
in my component.ts
for the one element.
Am I able to drop one of these attributes but still achieve both functionalities? Or is this boilerplate?