Skip to content

Instantly share code, notes, and snippets.

@calacitizen
Created April 12, 2016 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calacitizen/88695d48b70c38b13a9af3de0bed1f6e to your computer and use it in GitHub Desktop.
Save calacitizen/88695d48b70c38b13a9af3de0bed1f6e to your computer and use it in GitHub Desktop.

####Использование контролов в вёрстке

Шаблон компонента "MyComponent"

   <span>{{variable}}</span>
var html = '<div><component data-component="MyComponent" variable="321" /></div>'

tmpl.template(html).handle(function (ast) {
   tmpl.process(ast, {}); // Результат работы <div><span data-template-id="bd1e70bd-d2ad-52ba-b0f5-7f93aa7be1f7">321</span></div>
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment