I am getting started with the Angular 2 (version 2.0.0-alpha.46) and creating a few components.
When creating the component with the below code:
Typescript:
import {ComponentMetadata as Component, ViewMetadata as View} from 'angular2/angular2';
@Component({
selector: 'my-component'
})
@View({
template: '<div class="myClass">Hello My component</div>'
})
export class MyCompoent{
constructor() {
console.info('My Component Mounted Successfully');
}
}
HTML:
<my-component></my-component>
It works fine, but when i do Inspect element
, I can see a tag generated like this:
Output HTML
<my-component>
<div>Hello My component</div>
<my-component>
Problem
it keeps the <my-component>
tag in the HTML, and some of my CSS are not working as expected.
Question
Is there a way to remove the <my-component>
tag similar to angular 1 (replace: true
in the directive)?