bem / bem-xjst

bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
https://bem.github.io/bem-xjst
Other
116 stars 48 forks source link

[1.x] Templates work incorrectly after reapply() #105

Closed mishaberezin closed 8 years ago

mishaberezin commented 9 years ago

bem-xjst@1.2.1

BEMJSON:

({
    block: 'block',
    mods: {hello: 'world'},
    title: {block: 'i-bem', elem: 'i18n', keyset: 'block', key: 'title'}
});

BEMHTML:

block('block')(
    attrs()(function() {
        return {
            title: this.reapply(this.ctx.title)
        };
    })
);

block('block').mod('hello', 'world')(
    content()(function() {
        console.log('CONTENT');
    })
);

Nothing in console, second template didn't work.

mishaberezin commented 9 years ago

cc @indutny @veged @arikon

Critical for islands. Block link doesn't work in some cases.

arikon commented 9 years ago

@indutny Have a look please

indutny commented 9 years ago

Should be fixed by https://github.com/bem/bem-core/pull/1224 as well.