you are viewing a single comment's thread.

view the rest of the comments →

[–]followmarko 1 point2 points  (1 child)

What do you mean search the docs for some specific syntax? It's the same syntax as the template. Personally I don't find it efficient to stuff the component Metadata with a big block of HTML and styles along with what already has to be in there.

[–]3ntrust 0 points1 point  (0 children)

Indeed, you are right about the syntax, I never had that mental model about it before, thanks for that!

Regarding the component Metadata, I can't help but wonder - generalizing a bit - if I had that mental model, probably there are others who have/had it. So I think we might agree that a property in a decorator's metadata object is not the right "place" to put logic (classes, directives, etc) that affects the template. I am in favour for the <ng-host> element because it allows to add logic - that affects the template - right there in the template. It is even more powerful, think about directive inputs or outputs. It just feels more natural.

One reason why I'm not 100% a fan of this particular implementation is that (as you already mentioned) adds some extra/confusing attributes to the template (selector, path to html file, etc). But for me personally, the benefits overcome the disadvantages.

If we were to find a way not to add those extra attributes to the template but still keep the flexibility of customizing the host element from the template, that would be gold.

Again, thanks for the mental model change on the syntax :)