Coder Social home page Coder Social logo

elado / angular-rails-templates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pitr/angular-rails-templates

0.0 2.0 0.0 349 KB

Use your angular templates with rails' asset pipeline

Home Page: https://rubygems.org/gems/angular-rails-templates

License: MIT License

angular-rails-templates's Introduction

Angular Rails Templates Build Status

Behind the hideous Angular Rails Templates name is hiding a template management system for rails' asset pipeline and AngularJS' template views.

Basically: this will precompile your templates into the template cache, to be used by your application. It removes the need for ajax calls to get the templates (or for you to manually set them into the dom).

Usage

Add the gem into your Gemfile

gem 'angular-rails-templates'

Then, in your application.js file, require your templates and the internal javascript file:

//= require angularjs
//= require_tree ./path_to_your_templates

Your template files can have the extensions .html or .ajs

In your application, add a dependency to the templates module.

var application = angular.module('myApplication', ['templates']);

Loading this module will automatically load all your templates into angular's $templateCache. Angular uses this parameter when checking for the presence of templates before making an HTTP call.

How it works

We create the templates module (configurable through config.angular_templates.module_name in your application.rb), which populates Angular's $templateCache with all your templates when the module is included in your app.

License

MIT License. Copyright 2013 Damien Mathieu

Authors & contributors

angular-rails-templates's People

Contributors

danielberndt avatar dmathieu avatar pitr 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.