Closed pikhovkin closed 6 years ago
@antonmedv, example, please
Read the docs
I didn't find this in docs. I would not ask if it was there.
Define template with text/monkberry.
<script type="text/monkberry" id="component">
<h1>
Hello, {{ name }}!
</h1>
</script>
And you now can get access to component template.
var view = Monkberry.render(component, document.body);
@pikhovkin templates in monkberry-standalone evaluated in global scope. So you can render them with little trick: var view = Monkberry.render(window['Template'], document.body);
If you need to identify them by strings
@DeLaGuardo, exactly! Thanks!
How to render template by name (name has string type)? I need to pass the name of the template as a string.
Example: