微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javascript-@Component和Class之间的angular2关系

组件控制器类和组件之间的关系是如何形成的.它是否仅基于定位,是因为任何类都在给定组件之后,所以它将成为在其之前定义的组件的组件控制器类.如果您在一个js文件中包含多个组件,它是如何工作的.您如何将js文件中任何位置的类与组件相关联.

同样,存在子组件之类的东西,在这种情况下,这些子组件会从父组件(更具体地说是从父组件的组件控制器类)继承某些东西.

解决方法:

How is the relationship between a component controller class and the component is formed. Is it simply based on the positioning that whatever class comes after a given component, it becomes the component controller class for the component defined before it.

是.

How does it works if you have multiple components in a single js file

具有以下结构:

@Component ...
class Foo ...

@Component ...
class Bar ...

Is there such a thing as child components and in that case do these child components inherit something from parent components and more specifically from the component controller class of parent component.

组件不继承.组件组成.搜索继承与组成(但我确定您知道这一点).

另请参阅:https://github.com/Microsoft/TypeScript/issues/2249

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐