Why are there no directives used in some parts of the documentation

I was wondering why directives aren’t used as examples in some parts of the documentation?

For example I see there’s a ion-list directive but when I go to the list component from the CSS part of the docs you just use a normal unordered list. Why isn’t the directive used in the example and what is the best practice?

Could someone clarify this for me?

I imagine it’s generally not a bad idea to favor CSS classes over directives unless you need the extra functionality the directive provides, as it saves Angular having to instantiate things. That said, I can’t imagine the performance hit is too significant, so if it makes your markup clearer/easier to write, I think always using the directives is a valid choice as well. I could be wrong though!

1 Like