Fetching contributors…
Cannot retrieve contributors at this time
41 lines (39 sloc) 1.3 KB
<!DOCTYPE html>
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
The complete set of authors may be found at
The complete set of contributors may be found at
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at
<script src="load.js"></script>
<h1>Model-driven Views</h1>
<template id="greeting" repeat="{{ salutations }}">
<li>{{ what }}: <input type="text" value="{{ who }}"></li>
document.addEventListener('DOMContentLoaded', function() {
var t = document.getElementById('greeting');
var model = {
salutations: [
{ what: 'Hello', who: 'World' },
{ what: 'GoodBye', who: 'DOM APIs' },
{ what: 'Hello', who: 'Declarative' },
{ what: 'GoodBye', who: 'Imperative' }
t.model = model;
// Needed to detect model changes if Object.observe
// is not available in the JS VM.