Skip to content

model change doesn't update the view with data-text #162

@timaschew

Description

@timaschew

So this issue is not about the initial rendering, it' about changing the model after the initial rendering.

For arrays and each it works fine:

var template = '<ul><li each="list">{this}</li></ul>';
var model = {
    list: ['a', 'b', 'c']
};
var view = reactive(template, model);
window.model = model;

If I load the page and then change it via the browser console with commands like
window.model.list.pop() or window.model.list.push('d')
the view is updated automatically

If I do the same with just a simple string and data-text instead of an array it doesn't work anymore:

var template = '<h1 data-text="title"></h1>';
var model = {
    title: 'foobar'
};
var view = reactive(template, model);
window.model = model;

any changes via window.model.title = 'test' had no effects, even if I use component model

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