Skip to content

Binding doesn't work as expected #113

@pro100sanya

Description

@pro100sanya

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..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions