[nativescript-platform-css] Not picking the style when using className


#1

Hi there, I am creating Labels on the fly and I need to set a style to the Label, in my component, I import the css file but its not picking up the correct style, this is my code:

let title = new Label();
title.text = "My Title";
title.className = "font-16 my-title";
title.color = new Color("black");
container.addChild(title);

This is my css:

.phone :host .my-title {
    ...
}

Any idea? Thanks!


#2

Are you using Angular?


#3

Hey @manojdcoder, yes I am using Angular (~6.1.0).

Any idea?