mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3373 from Polymer/filaraujo-feature/domTemplate
dom-template: parentProps should not override argument based props
This commit is contained in:
commit
a6d948553a
@ -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);
|
||||
|
@ -66,6 +66,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
'unit/templatizer.html',
|
||||
'unit/dom-repeat.html',
|
||||
'unit/dom-if.html',
|
||||
'unit/dom-template.html',
|
||||
'unit/dom-bind.html',
|
||||
'unit/script-after-import-in-head.html',
|
||||
'unit/globals.html'
|
||||
|
@ -11,9 +11,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="../../../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../../../web-component-tester/browser.js"></script>
|
||||
<link rel="import" href="../../../polymer.html">
|
||||
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../../web-component-tester/browser.js"></script>
|
||||
<link rel="import" href="../../polymer.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -21,6 +21,38 @@ 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>
|
||||
HTMLImports.whenReady(function() {
|
||||
|
||||
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 +63,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