你好.我是Angular的新手.我正在测试Angular 2.0.
我读的政党成员在这里和导向这里.在tuto中,模板在@Component
注释中指定,而在指南中,它在@View
注释中.所以我想知道这两种方法有什么区别?我在api预览中查了一下,但解释并不清楚.
ale*_*ods 25
更新
@View()
被删除(我认为在beta.13中,CHANGELOG.md没有提到它).
原版的
它们之间没有区别.您可以将所有视图配置指定为糖,Component
因此无需导入View
装饰器.
但与此同时,还需要保留View
装饰器,因为它允许我们根据语言或媒体类型对同一组件使用不同的视图.例如:
@Component(/* ... */)
@View({
media: 'desktop',
template: 'Template for desktop'
})
@View({
media: 'mobile',
template: 'Template for mobile'
})
extends class Component() {}
Run Code Online (Sandbox Code Playgroud)
此功能尚未实现.
归档时间: |
|
查看次数: |
16930 次 |
最近记录: |