Giter VIP home page Giter VIP logo

require-ember-handlebars-plugin-pods's Introduction

Require.js Ember Handlebars Plugin.

Modification for migration to pods stucture.

Automatic requires of template calls to helpers, views, controllers and partials.

Usage

Write an Ember Handlebars template like so:

pods/email/template.hbs

<section>Welcome to my awesome app!</section>

Then require the template with your route:

require(["podhbs!pods/email"], function() {
  // pods/email/template.hbs now exists in Ember.TEMPLATES.email  
});

Config

You can configure the paths for the plugin to look up resources, like so:

require.config({
  podshbs: {
    paths: {
      templates: "foo/bar/templates",
      views: "foo/bar/views",
      controllers: "foo/bar/controllers",
      helpers: "foo/bar/helpers"
    }
  }
})

You can also configure the type of casing used on your files, like so:

require.config({
  podshbs: {
    casing: "camel"
  }
})

Valid options are:

  • camel - require("ehbs!coolTemplate") will load templates/coolTemplate.hbs
  • class - require("ehbs!coolTemplate") will load templates/CoolTemplate.hbs
  • underscore or snake - require("ehbs!coolTemplate") will load templates/cool_template.hbs

Tests

Open up tests/index.html in your browser.

Todo

  • Builds
  • i18n
  • More robust and deeper testing
  • Pull out ES5 functions for IE6-8 support.

License

MIT

require-ember-handlebars-plugin-pods's People

Contributors

tbranyen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.