i am building a tree structure in angular 4. my issue is i have to start each node at the same level and indent only the name text from the left border. for every node i have got the depth of the node. i want to add a style like this.
<p style="padding-left : calc_padding(depth)"> some Text </p>
calc_padding(depth){
return depth *5
}
how can i do that.
i have read style sanitizer but could not find how to use it in my case.
i have tried to impliment [style] = "method(depth)"
and [style.padding-left] = "method(depth)" but i am unable to get the things done as i have wanted.
Any help in this regard will be appreciated.