Hey there,

Programmer of _many_ years, but still relatively new to Angular. Switching 
over several AngularJS applications to Angular 5 and as part of that 
project we are creating several common modules/components that we will use 
throughout the applications. To enable the parent to still be able to 
override the styling on these components we had been using 'class' as an 
@Input into the component, here is an example of a badge component that is 
using bootstrap styling:

<app-badge name="badge8" type="normal" class="badge-dark">Dark</app-badge>

This all looks good and easy to remember for other devs. The problem, as 
I'm sure the more experienced among you can see, is that when the component 
is rendered both the <app-badge> and the inner <span> (in this example) 
have the class="badge-dark" attached and so it doesn't give the desired 
styling. I can obviously solve this issue by changing the attribute from 
class to <something else>. And this totally solves the problem. My issue is 
simply, if others have had similar issues... what did you end up calling 
the attribute? To prove my solution I just made it 'cls'... but that looks 
kinda crappy. All my brain can think of is class and style! ;-)

Anyone have any other thoughts on something that 6 months from now a new 
developer will look at the code and know that that is the class I'm trying 
to pass in.

Thanks!

Warwick

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to