Merge branch 'feature/domTemplate' of https://github.com/filaraujo/polymer into filaraujo-feature/domTemplate

This commit is contained in:
Kevin Schaaf 2016-02-04 09:29:37 -08:00
commit d69ee9a35e
2 changed files with 36 additions and 1 deletions

View File

@ -416,7 +416,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
if (this._parentProps) {
var templatized = this._templatized;
for (var prop in this._parentProps) {
model[prop] = templatized[this._parentPropPrefix + prop];
if (model[prop] === undefined) {
model[prop] = templatized[this._parentPropPrefix + prop];
}
}
}
return new this.ctor(model, this);

View File

@ -21,6 +21,34 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<span>{{text}}</span>
</template>
<dom-module id="test-dom-template">
<template>
<template is="dom-template" id="tmpl">
<span>{{text}}</span>
</template>
</template>
<script>
Polymer({
is: 'test-dom-template',
properties: {
value: String
},
ready: function() {
var tmpl = this.$.tmpl.stamp({
text: 'ohai'
});
this.value = tmpl.root.textContent.trim();
}
});
</script>
</dom-module>
<test-dom-template id="testDom"></test-dom-template>
<script>
suite('<dom-template>', function() {
@ -31,6 +59,11 @@ suite('<dom-template>', function() {
assert.equal(row.root.textContent.trim(), 'ohai');
});
test('stamps within an element', function() {
var template = document.querySelector('#testDom');
assert.equal(template.value, 'ohai');
});
});
</script>