flatiron / plates

Light-weight, logic-less, DSL-free, templates for all javascript environments!
MIT License
831 stars 69 forks source link

Binding doesn't work as expected #113

Open pro100sanya opened 10 years ago

pro100sanya commented 10 years ago

I am trying to pass example from wiki on clean data binding. Have this code:

var html = "<p data-bind='para'></p><input type='text' data-bind-value='name' data-bind-placeholder='placeholder'/>";

var data = { "name": "Frank", "placeholder": "Some dude", "para": "Some Paragraph" };

var output = Plates.bind(html, data);

And I have this in browser:

<body>
    <p data-bind="para">Some Paragraph</p>
    <input type="text" data-bind-value="name" data-bind-placeholder="placeholder">Frank
    <input type="text" data-bind-value="name" data-bind-placeholder="placeholder">Some dude
</body>

I supposed that bound values should be just replaced. But have got something another.

I cannot get what I am doing wrong..

davidamitchell commented 10 years ago

What is the output you are expecting?