我有两个组件,我想从中转换md-hint
在md-input标签内的上面一个,md-input应该从那里开始
渲染它。
现在这不起作用。任何人都可以向我解释如何
我可以达到我想要的结果吗?
@Component({
selector: 'my-test',
template: `
<div>
<md-input placeholder="Test">
<ng-content selector="md-hint"></ng-content>
</md-input>
</div>
`,
})
export class MyTest {
name:string;
constructor() {
this.name = 'Angular2'
}
}
@Component({
selector: 'my-app',
template: `
<div>
<h2>Hello {{name}}</h2>
<my-test>
<md-hint>This is my hint</md-hint>
</my-test>
</div>
`,
})