New issue
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
Components with imperative views #1088
Comments
Can you give an example of what the API for moving child elements would look like? |
|
This sounds like what @tbosch and I have been calling "render directive". I think directives that access platform-specific APIs should not participate in data binding, DI, the view hierarchy, or anything else that lives in the "application layer". According to the new rendering architecture such directives would live in the render layer. The API available to this type of directive should be sufficient to implement:
|
If this type of directive does not participate in DI, you lose the ability to make a directive that uses something like @yjbanov are you suggesting that a directive that uses canvas wouldn't be able to define custom property bindings? |
Here's a use case that might inform this: In Material 1, we have a directive called $mdIconProvider
.defaultIconSet('my/app/icons.svg') // Register a default set of SVG icons
.iconSet('social', 'my/app/social.svg') // Register a named icon set of SVGs
.icon('android', 'my/app/android.svg') // Register a specific icon (by name)
.icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set and then referenced by name: <md-icon md-svg-icon="info"></md-icon>
<md-icon md-svg-icon="social:cake"></md-icon> In Angular two, the analog to this provider would be creating a service at the root level "app" component. The directive would need to consume this service to look up the SVG content by name, and then append the content into its DOM. The specific icon set to the directive could also be determined by some binding. |
@jelbourn While render directives do not participate in DI, you can still data-bind to them. In your example
However, internally, it would use a render directive and pass data to it, e.g. this way:
Here |
/everyone, I have update the bug description, please take a look. |
@mhevery, I moved this back to M7 because this is blocking cubicle table migration. |
Implemented basic feature to update the DOM via Note that the internal name is "Component with an imperative View", not "Native Component". |
Missing:
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
A component which is responsible for rendering its own shadow DOM rather then loading it from template.
The mental model is that this is a component, but because it does not have a
@Template
it is responsible for rendering its own content. To reproject the light DOM it can add<content>
tag. The component can injectDocumentFragment
to do its own DOM manipulation. (WebWorkers, will be addressed seperatly).Single Thread Model
@Component
ContentDom
abstraction, described later.ComponentDom
AbstractionBecause Angular runs in both Emulated and Native Shadow DOM mode, it is important that we abstract the API for shadow DOM so that Angular's emulation mode will know when and which nodes to redistribute.
WebWorkers Model
See #1207
The text was updated successfully, but these errors were encountered: