Answer the question
In order to leave comments, you need to log in
How to access the template engine on the client?
Hello, please help me, why I still can’t get bemhtml on the client, everything seems to be ok and the dependencies and everything called. and yes, such a question, if I write everything through bemtree (well, as bemhtml I have purely for tagging and attributes, that is, so far there are only different trifles) and in fact I don’t have a template, I just want to use the template engine itself on the client, which I do not So?
modules.define('manager', ['i-bem__dom', 'BEMHTML', 'menu', 'jquery'], function(provide, BEMDOM, BEMHTML, MenuEvent, $) {
provide(BEMDOM.decl(this.name, {
onSetMod : {
'js' : {
'inited' : function() {
MenuEvent.on('update', this._taskUpd, this);
}
}
},
_taskUpd : function () {
this.setMod(this.elem('content'), 'action', 'artAdd');
var bemjson = {
block: 'content',
content: [
]
};
var html = BEMHTML.apply(bemjson);
console.log(html);
BEMDOM.update(this.elem('content'), html);
return false;
}
}));
});
({
shouldDeps: [
{ elem: 'control'},
{ elem: 'content'},
{ mods: { action: 'article'} },
{ block: 'modal', mods : { theme : 'islands', autoclosable : true }},
'button',
'content',
'menu',
{ block: 'i-bem', elem: 'dom' },
{ tech: 'js', mustDeps: { elem: 'content', tech: 'bemhtml' } }
]
})
Answer the question
In order to leave comments, you need to log in
[{
shouldDeps: [
{ elem: 'control'},
{ elem: 'content'},
{ mods: { action: 'article'} },
{ block: 'modal', mods : { theme : 'islands', autoclosable : true }},
'button',
'content',
'menu'
]
}, {
tech: 'js', // зависимости для технологии js
shouldDeps: [
{
block: 'content',
tech: 'bemhtml' // нужна технология bemhtml
}
]
}]
Shouldn't the dependencies look like this?
({
shouldDeps: [
{ elem: 'control'},
{ elem: 'content'},
{ mods: { action: 'article'} },
{ block: 'modal', mods : { theme : 'islands', autoclosable : true }},
'button',
'content',
'menu',
{ block: 'i-bem', elem: 'dom' }
]
}, { tech: 'js', mustDeps: { elem: 'content', tech: 'bemhtml' } })
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question