-
Notifications
You must be signed in to change notification settings - Fork 248
Feature Request: Add templates for NgDirectives or a NgComponent non-shadow dom option #367
Comments
What you are asking for is to have NgComponents which don't use shadow dom. This would require that we reimplement shadow dom as transclusion. Not sure I would like to go that route. This is a ShadowDOM issue and should be taken up with ShadowDOM folks. |
The Shadow DOM solution to the broken CSS selectors is the use pseudo elements. I've hacked up a ng-pseudo directive that should solve your problem. Please take a look at it and let me know. In the Todo app's "TypeComponent", we are using ng-pseudo to tag a span as 'x-text'. demo/todo/todo.dart line 116 In the light DOM's css file, we can now say: li:hover todo-type::x-text, demo/todo/todo.css line 51 |
@jbdeboer thanks for pointing me to the ng-pseudo directive. It is very handy and I will definitely use it in the future. But what remains is the nested component question.
would be useful, but I can understand your concerns But there is one feature of NgComponent that is definitely missing for me: Lets say I want to develop a new full calendar component, that has sub components like example:
With the current NgComponent all of the child component are exposed to "document" via the
or
if this attribute is available replace the |
@demike I do this by in mycomponent
And on the tag in the mycomponent template where I want to have them transcluded to I add
Works fine so far. Now also when the trancluded nodes contain bindings/directives. |
I'm trying to migrate an existing angularjs app to angular.dart, however, the fact that every component creates a shadow dom makes working with angular.dart a real pain. In addition, testing nested components is very hard. |
I would also like an option to override shadow dom for certain components. |
Seems like @NgComponent should support shadowDom:false flag. |
or lightDOM true as in Polymer but AFAIR they are going to remove it (or have already) |
@mhevery - I agree. I use bootstrap and I'd like to implement a component that reduces this mess (per input element!):
to something more like:
so that I can stamp out forms more consistently and quickly... but the shadowdom / boostrap combo denies me this glory. There are a number of cases, however, where I benefit from the encapsulation that the shadowdom provides... the choice would really be nice. |
Anyone wants to take a stab at it? This one is a hard one. :-) |
This is very important feature. Because otherwise (with shadowdom option) it is very difficult to use twitter bootstrap, semantic-ui like existing css frameworks with angulardart. |
Ran into another NgComponent shadow dom limitation... jquery ui... I wish I knew enough about the implementation to help you out with this @mhevery :-) |
@codelogic is working on this. |
lol! milestone? 👏 |
nice! thanks @codelogic!!!! |
Good news on this morning! Thanks. |
Looking forward to see any progress on this item and try it out. Developing UI for Dart web apps never was easy, but after deprecating It's hard to communicate to the management that we completely switch the direction we are working on every couple of weeks. Yesterday it was Shadow DOM, today we rely on |
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:
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:
Like depicted in the image above it breaks css selectors like
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?The text was updated successfully, but these errors were encountered: