We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这是directive 的,component的应该也差不多吧 这里面所有参数都是optional的。 就是说 你可以new一个空指令,或者空组件。但意义何在呢?
难道是为了继承?
constructor({selector, inputs, outputs, properties, events, host, bindings, providers, exportAs, queries}?: { selector?: string, inputs?: string[], outputs?: string[], properties?: string[], events?: string[], host?: {[key: string]: string}, providers?: any[], /** @deprecated */ bindings?: any[], exportAs?: string, queries?: {[key: string]: any} })
The text was updated successfully, but these errors were encountered:
@component中的selector主要用来是匹配HTML中的自定义标签,使自定义标签实现组件的功能。 但是在非directive形式加载组件时,比如使用DynamicComponentLoader加载或者使用路由来加载,selector其实可以不需要(这种情况不写selector是不会报错的)。
selector
directive
在beta0的angular2,如果不写的话selector则为undefined,会创建一个undefined的标签,当然这个问题官方已经计划在下一版修正掉,如果你不写selector,默认会使用一个div标签,具体可看 angular/angular#1662 (comment)
undefined
div
Sorry, something went wrong.
No branches or pull requests
这是directive 的,component的应该也差不多吧
这里面所有参数都是optional的。
就是说 你可以new一个空指令,或者空组件。但意义何在呢?
难道是为了继承?
The text was updated successfully, but these errors were encountered: