In Angular2 we add annotations to a component to describe metadata for the given component. I've noticed that ComponentMetadata
and ViewMetadata
both have templateUrl
and template
properties. What is the difference between ViewMetadata.template
(or templateUrl
) vs ComponentMetadata.template
, and what would be practical use cases for using one over the other?
In one of the recent updates of angular2, @View was made optional. All of its properties moved into @Components. As of now, @View is redundant.
I my applications, I use only the Component decorators. I find this approach easy to write and maintain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With