Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 676 Bytes

README.md

File metadata and controls

38 lines (28 loc) · 676 Bytes

HtmlAssets

HtmlAssets includes static html templates in the asset pipeline so you can use them in Javascript. Think Angular.

Install

gem install html_assets

In application.js

//= require html_assets
//= require_tree ./html

In the browser

console.log(HTML_Assets)

Optionally create a directive that renders partials in your angular templates.

  App.directive 'htmlAsset', ->
    definition = 
      replace: true
      restrict: 'A'
      compile: (tElement, tAttrs, transclude) ->
        tElement.html(HTML_Assets[tAttrs.htmlAsset])
  <div html-asset="tasks/form"></div>