-
Notifications
You must be signed in to change notification settings - Fork 3
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
Inject template and tests #3
base: master
Are you sure you want to change the base?
Conversation
Test 4 is failing to prove there's an issue with this.$.* in base elements. Test 5 proposes a possible fix by doing a regex search and replace? |
Let's add a test for the CSS as well! Is that getting copied over just fine? |
Awesome start! Can we nix the |
@@ -55,6 +55,17 @@ | |||
behaviorDefinition[key] = thisPrototype[key]; | |||
} | |||
|
|||
behaviorDefinition.injectFrom = function(base, target) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be another method passed to _addFeature
.
@@ -55,6 +55,17 @@ | |||
behaviorDefinition[key] = thisPrototype[key]; | |||
} | |||
|
|||
behaviorDefinition.injectFrom = function(base, target) { | |||
var baseElement = document.createElement(base); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if base
isn't an element that's being mixed in to the ext component? I suppose this function could care and enforce that, or it could work for any base
element type. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of injectFrom is to be an accessory of .toBehavior and should only be used in a misbehaving element for the purpose of getting the inherited template. I think we should enforce that base be 'one of' the elements .toBehavior-ing in the ext component.
Will this respect bindings? We need an I'm not sure about how to deal with styles... |
loL that SO post is where I found the misbehavy fix for injecting HTML grabbed from an ajax call. As for styles... Let's just look for a |
There's an issue in my code with the code from 'another-component' executing once with all undefined props, etc. and a 2nd time with everything working fine. |
And I'm failing the 'preserves sub-behaviors' test still, I haven't tried to fix it, hoping for it to work itself out while merging this with your other things. The this.$.* tests pass though!! |
|
||
// And baseTemplateInstance will only have a children array if it hasn't been added to the DOM yet! | ||
var self = this; | ||
Polymer.dom(baseTemplateInstance).children.forEach(function(child) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about children's children, etc.? Hopefully there's a way we can get Polymer to do this work. More info possibly here: https://github.com/Polymer/polymer/blob/b0733d3c07f071cb05ae88473cd07caee20ffe03/src/standard/annotations.html
No description provided.