Giter Site home page Giter Site logo

psaravanan / angularjs-on-rails Goto Github PK

View Code? Open in Web Editor NEW

This project forked from raj-optisol/angularjs-on-rails

0.0 2.0 0.0 555 KB

wraps the AngularJS library for use in Rails 3.1 and above. This project is an application skeleton for a typical AngularJS web app. You can use it to quickly bootstrap your angular webapp projects.

License: MIT License

angularjs-on-rails's Introduction

AngularJS on Rails Gem Version

wraps the AngularJS 1.2.18 library for use in Rails 3.1 and above. This project is an application skeleton for a typical AngularJS web app. You can use it to quickly bootstrap your angular webapp projects.

Installation

In your Gemfile, add this line:

gem 'angularjs-on-rails'

Then run the following commands:

bundle install
rails g angular:install

Angular App Structure

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

|-- app_name.coffee
|-- index.html
|	|-- controllers/
|		|-- app_name-controller.coffee
|	|-- directives/
|		|-- app_name-directive.coffee
|	|-- filters/
|		|-- app_name-filter.coffee
|	|-- services
|		|-- app_name-service.coffee
|	|-- styles
|	|-- views

Add's the following directive's to your JavaScript manifest file (application.js):

//= require angular
//= require angular/app_name

If you desire to require (optional) Angular files, you may include them as well in your JavaScript manifest file (application.js). For example:

//= require angular-animate
//= require angular-resource

If you want to Skip Git ignores and keeps

rails g angular:install -G

AngularJS vs. Turbolinks

Turbolinks as well as AnguluarJS can both be used to make a web application respond faster, in the sense that in response to a user interaction something happens on the web page without reloading and rerendering the whole page.

They differ in the following regard:

AngularJS helps you to build a rich client-side application, where you write a lot of JavaScript code that runs on the client machine. This code makes the site interactive to the user. It communicates with the server-side backend, i.e. with the Rails app, using a JSON API.

Turbolinks, on the other hand, helps to to make the site interactive without requiring you to code JavaScript. It allows you to stick to the Ruby/Rails code run on the server-side and still, "magically", use AJAX to replace, and therefore rerender, only the parts of the page that have changed.

Where Turbolinks is strong in allowing you use this powerful AJAX mechanism without doing anything by hand and just code Ruby/Rails, there might come a stage, as your application grows, where you would like to integrate a JavaScript framework such as AngularJS.

Especially in this intermedium stage, where you would like to successively integrate AngularJS into your application, one component at a time, it can make perfectly sense to run Angular JS and Turbolinks together.

..more

Contributing to AngularJS on Rails

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

About us

Optisol Business Solutions

Copyright

Copyright (c) 2014 Rajendran S. See LICENSE.txt for further details.

angularjs-on-rails's People

Contributors

raj-optisol avatar ramamoorthyobs avatar

Watchers

James Cloos avatar Saravanan Pandiaraj 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.