Skip to content

Input value is not initialised. #213

Closed
@treshugart

Description

Given the following element and accompanying model, the input is not initialised with the default title of "asdf".

<polymer-element name="todo-list">
  <template>
    <form>
      <input id="title" type="text" value="{{ title }}" placeholder="New Todo Title">
      <button type="button" on-click="add">Add</button>
    </form>
    <ul>
      <template repeat="{{ todos }}">
        <li>{{ title }}</li>
      </template>
    </ul>
  </template>
  <script>
    Polymer('todo-list', {
      title: 'asdf',
      todos: [],
      add: function() {
        this.todos.push({ title: this.title });
        this.$.title.value = '';
      }
    });
  </script>
</polymer-element>

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions