我想引用A.中的组件属性,该组件的构造函数B.该组件的模板。这个API的似乎是移一点点,但是我希望下面的工作:绑定到angular2中的组件属性
<my-component [greeting]="hello"></my-component>
// my component.es6.js
@Component({
selector: 'my-component',
properties: {
'greeting': 'greeting'
}
})
@View({
template: '{{greeting}} world!'
})
class App {
constructor() {
console.log(this.properties) // just a guess
}
}
我在做什么错?
我不知道这是可能的角的当前版本。我探讨了'angular2_material'如何处理它,但是当我尝试这些技术时,它或者什么也不做,或者它们使用我的angular2中找不到的特性(从npm时刻开始)。 (1)'[md-button] [href]'是一个简单的例子,我发现简单地期望'tabIndex'(使用'hostProperties',而不是'属性')将被绑定到对象,但是在我的代码中,它永远不会。 (2)'md-radio-button'使用@Attribute,TypeScript不会为我编译(angular2/angular2没有导出的成员'Attribute')。 – Langdon
@Langdon有趣,感谢您的调查!现在似乎事情有点不稳定,这是可以预料的。 –