I think there is an way to simplify "pulling" declarative content into implementation.
It should be able to change the RenderPortal component mixin into a helper:
{{render-portal declarations className itemIndex itemSubindex}}
Here declarations are the list of PortalDeclaration collected. className is name of subclass of PortalDeclaration to filter by, itemIndex the # of the delcaration, and itemSubindex the index of the subclass of this.element presented by the PortalDeclaration instance.
For nested declarations, this could be used as:
{{render-portal declarations class1 item1 sub1 class2 item2 sub2 [etc as necessary] }}
In many situations, I'm hoping that this would eliminate the need for any render/... components. Of course, sometimes you might want them anyway (dynamic styling can't be guessed in declaration context perhaps?), but I think often they are just boiler plate.
I plan to try this out on a branch and use in ember-smenu ... if it looks good there we can try to re-base ember-grid on ember-declarative.
I think there is an way to simplify "pulling" declarative content into implementation.
It should be able to change the RenderPortal component mixin into a helper:
Here
declarationsare the list ofPortalDeclarationcollected.classNameis name of subclass ofPortalDeclarationto filter by,itemIndexthe # of the delcaration, anditemSubindexthe index of the subclass ofthis.elementpresented by thePortalDeclarationinstance.For nested declarations, this could be used as:
In many situations, I'm hoping that this would eliminate the need for any
render/...components. Of course, sometimes you might want them anyway (dynamic styling can't be guessed in declaration context perhaps?), but I think often they are just boiler plate.I plan to try this out on a branch and use in
ember-smenu... if it looks good there we can try to re-baseember-gridonember-declarative.