Ember.js Asset-Pipeline Plugin

2 votes
Dependency :
compile ":ember-asset-pipeline:1.4.0.2"

Documentation Source Issues

Summary

Provides Ember.js integration with asset-pipeline. Allows for handlebars precompilation as well as scaffolding for building an emberjs application.

Installation

grails install-plugin ember-asset-pipeline

Description

The Grails `ember-asset-pipeline` is a plugin that provides ember handlebars template precompiler support to asset-pipeline as well as emberjs dependencies and scripts for getting started.

For more information on how to use asset-pipeline, visit here.

Scaffolding

grails ember-bootstrap
#or 
grails ember-bootstrap --javascript-engine=coffee

Ember does not require an organized file structure. However, this plugin allows you to use `grails ember-bootstrap` to create the following directory structure under `grails-app/assets/javascripts`:

controllers/
    helpers/
    models/
    routes/
    templates/
    views/

Note: This plugin includes some flag options for the bootstrap generator:

--ember-path or -d # custom ember path
--javascript-engine  # engine for javascript (js or coffee)
--app-name or -n # custom ember app name

Precompiling

Ask Grails to serve HandlebarsJS and pre-compile templates to Ember by putting each template in a dedicated ".handlebars", or ".hbs" file (e.g. `grails-app/assets/javascripts/templates/admin_panel.handlebars`) and including the assets in your layout:
<asset:javascript src="templates/admin_panel.js"/>