Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Feature Request: Add templates for NgDirectives or a NgComponent non-shadow dom option  #367

Closed
@demike

Description

@demike

When trying to port the angular-ui bootstrap components to dart I stumbled uppon a problem with nested directives / components and css selectors.

For example the progress and bar directives in angular-ui bootstrap:

<progress max="100">
  <bar type="'warning'" value="29"></bar>
  <bar type="'danger'" value="2"></bar>
</progress>

in angular-ui this works fine (without shadow dom)

Using a NgComponent for 'progress':
First problem: can't create shadow dom because the Html5 progress element exists.
Ok rename it to 'prog'

The real problem is how the inserted content is handled in shadow dom:
Image

Like depicted in the image above it breaks css selectors like

.progress .bar-danger {
  ...
}

and that holds true for nesting NgComponent > NgDirective and
NgComponent > NgComponent.

This can make working with angular.dart (actually with shadow dom, angular.dart is cool ;) ) a pain.
So my request would be to add 'template' and 'templateUrl' to
NgDirective or to add an option to NgComponent to replace the
hosting dom element with the given template instead of using shadow dom.

edit:
Is there some kind of transclude option for NgComponent that does not place the nested elements in the shadow dom <content></content> i am not aware of?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions