Skip to content

Commit d69ee9a

Browse files
committed
Merge branch 'feature/domTemplate' of https://github.com/filaraujo/polymer into filaraujo-feature/domTemplate
2 parents 4a9ef8e + 898fe89 commit d69ee9a

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

src/lib/template/templatizer.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,9 @@
416416
if (this._parentProps) {
417417
var templatized = this._templatized;
418418
for (var prop in this._parentProps) {
419-
model[prop] = templatized[this._parentPropPrefix + prop];
419+
if (model[prop] === undefined) {
420+
model[prop] = templatized[this._parentPropPrefix + prop];
421+
}
420422
}
421423
}
422424
return new this.ctor(model, this);

test/unit/template/dom-template.html

+33
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,34 @@
2121
<span>{{text}}</span>
2222
</template>
2323

24+
<dom-module id="test-dom-template">
25+
<template>
26+
<template is="dom-template" id="tmpl">
27+
<span>{{text}}</span>
28+
</template>
29+
</template>
30+
<script>
31+
Polymer({
32+
is: 'test-dom-template',
33+
34+
properties: {
35+
value: String
36+
},
37+
38+
ready: function() {
39+
40+
var tmpl = this.$.tmpl.stamp({
41+
text: 'ohai'
42+
});
43+
44+
this.value = tmpl.root.textContent.trim();
45+
}
46+
});
47+
</script>
48+
</dom-module>
49+
50+
<test-dom-template id="testDom"></test-dom-template>
51+
2452
<script>
2553

2654
suite('<dom-template>', function() {
@@ -31,6 +59,11 @@
3159
assert.equal(row.root.textContent.trim(), 'ohai');
3260
});
3361

62+
test('stamps within an element', function() {
63+
var template = document.querySelector('#testDom');
64+
assert.equal(template.value, 'ohai');
65+
});
66+
3467
});
3568

3669
</script>

0 commit comments

Comments
 (0)