mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Merge branch 'feature/domTemplate' of https://github.com/filaraujo/polymer into filaraujo-feature/domTemplate
This commit is contained in:
commit
d69ee9a35e
@ -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);
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user