https://github.com/gocardless/angularjs_template_assets
https://github.com/gocardless/angularjs_template_assets
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gocardless/angularjs_template_assets
- Owner: gocardless
- License: mit
- Created: 2013-02-21T12:07:03.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T21:49:07.000Z (about 4 years ago)
- Last Synced: 2025-01-14T08:52:54.083Z (5 months ago)
- Language: Ruby
- Size: 6.84 KB
- Stars: 0
- Watchers: 104
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# angularjs_template_assets
`angularjs_template_assets` does two things :
* Prefill Angular.js $templateCache with all the HTML templates in your /assets directory
* Since they’re now Javascrip file they’re compressed and cached as part of the standard assets processing of Rails pipeline.## Usage with Rails 3.1+
Add `angularjs_template_assets` to your Gemfile in the `assets` group :
```ruby
group :assets do
gem 'angularjs_template_assets'
end
```## Usage without Rails 3.1+
Although it hasn't been tested, `angularjs_template_assets` should be working with older version of Rails and with frameworks like Sinatra.
Add `angularjs_template_assets` to your Gemfile :
```ruby
gem 'angularjs_template_assets'
```Add the `AngularJSTemplateAssets.path` to your `Sprockets::Environment` instance. This lets Sprockets know where the Handlebars JavaScript files are and is required for the next steps to work.
```ruby
env = Sprockets::Environment.newrequire 'angularjs_template_assets'
env.append_path AngularJSTemplateAssets.path
```## TODO
* Write tests
* Allow to customize default namespace