Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/undr/angular_template
The handy way to utilize angular templates in rails using Sprockets
https://github.com/undr/angular_template
Last synced: about 1 month ago
JSON representation
The handy way to utilize angular templates in rails using Sprockets
- Host: GitHub
- URL: https://github.com/undr/angular_template
- Owner: undr
- License: mit
- Created: 2015-03-03T06:43:18.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-18T03:43:47.000Z (almost 10 years ago)
- Last Synced: 2024-04-24T13:22:13.582Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 121 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# AngularTemplate
The handy way to utilize angular templates in rails using Sprockets
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'angular_template'
```And then execute:
```
$ bundle
```Or install it yourself as:
```
$ gem install angular_template
```## Usage
Just put your angular templates in folder constructed by following pattern: `#{module}/templates/template_name`. This `module` can be a chain of modules. Eg. `application.ui.toolbox`. It means, templates for module `application.ui.toolbox` should be placed in folder `ui/toolbox/templates`. Also module `application.ui.toolbox.templates` will be created.
For example, this template:
```html
{name}
```will be converted into:
```javascript
angular.module('application.templates').run(function($templateCache){
$templateCache.put('some_template', '\n{name}')
});
```and this:
```html
{name}
```into:
```javascript
angular.module('application.ui.toolbox.templates').run(function($templateCache){
$templateCache.put('ui/toolbox/some_template', '\n{name}')
});
```Respectively they can be accessed by using following paths:
```
templateUrl: 'some_template'
templateUrl: 'ui/toolbox/some_template'
```## Contributing
1. Fork it ( https://github.com/undr/angular_template/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request