Git Product home page Git Product logo

angular-gem's Introduction

[Deprecated/Unsupported] Angular-Gem

Gem Version Build Status Dependency Status Code Climate Coverage Status

03/25/2015 - Unsupported: Due to the ETS Berkeley team now using npm for front-end dependencies, this gem is no longer supported.

This project lets you use AngularJS with the Rails 3.x asset pipeline. It was forked from the angular-rails gem, since the project seems to have been abandoned and there's been a need to keep angularjs up to date within our own internal projects. The version number will by default track the unstable branch, although there are plans to always have both the latest stable and unstable versions available. Looking inside the vendor folder should give you an idea of what's available.

Getting Started

Add the gem to your application Gemfile:

gem "angular-gem"

Run bundle install. To bootstrap things, run:

rails g angular:install

Specifying versions

  • By default, this gem will include the latest stable version of angular with //require angular in your application.<js/coffee> file.
  • You can switch to using the latest unstable version by pointing to //require angular-unstable.
  • You can also force specific versions to be loaded with //require <VERSION>/angular-<VERSION>, assuming the source files exist somewhere in the gem.

Internationalization support

  • Internationalization (i18n) files are bundled in starting from gem version 1.1.5. You will need to specify the version of the gem you are using currently in your paths though, like so: //require 1.1.5/i18n/angular-locale_de

Layout and namespacing

Running rails g angular:install will create the following directory structure under app/assets/javascripts/angular:

controllers/
filters/
services/
widgets/

It will also generate a templates/ directory under app assets, where view templates can be stored. This lets you use haml, etc. for your angular views.

It will also add to the application.js file the appropriate requires.

Generators

angular-rails provides a simple generator to help get you started using angular.js with rails 3.1. The generators will only create client side code (javascript).

So far we have a controller generator which generates a controller file if you rum

rails g angular:controller MODELNAME

This file is empty except for the class declaration, but I will be adding some RESTful controller functionality shortly.

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.