T-student T-student - 3 months ago 42
TypeScript Question

Angular2 component with selector not in the html

in the following pluker http://plnkr.co/edit/MC7gO55TGkQTrxaJnJir?p=preview

in the DashboardComponent class, in the file


is defined a @component with a selector but in the file .html
there is no selector equivalent, you can explain me how is possible?
you are not forced to define the selector tag ?


The router uses ViewContainerRef.createComponent() which doesn't need the selector to match HTML. See also Angular 2 dynamic tabs with user-click chosen components for an example.