Created
October 7, 2013 09:03
-
-
Save kirel/6864795 to your computer and use it in GitHub Desktop.
Angular template cache helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module AngularHelper | |
| # Usage: | |
| # In your server side rendered template | |
| # = ng_template 'path/to/partial', 'path/to/other/partial' | |
| # and then in i.e. angular directives | |
| # template: 'path/to/partial' | |
| def ng_template *partial_paths | |
| safe_join( | |
| partial_paths.map do |partial_path| | |
| content_tag 'script', render(partial_path), id: partial_path, type: "text/ng-template" | |
| end | |
| ) | |
| end | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TODO locals an partials übergeben können.