11
Rails + AngularJS Awesome web apps with o0khoiclub0o

Awesome web apps with rails + angular js

Embed Size (px)

DESCRIPTION

Material from Vu Dinh Khoi (a developer at Silicon Straits Saigon) "I'm a Rails developer. I've just started to do AngularJS for 2 weeks and I feel really excited with the way Angular do to design client-side applications. And I just want to share about 'How to integrate AngularJS to Rails', so easy." Connect with him here: http://www.linkedin.com/pub/khoi-vu-dinh/5a/6a/276

Citation preview

Page 1: Awesome web apps with rails + angular js

Rails + AngularJS

Awesome web apps with

o0khoiclub0o

Page 2: Awesome web apps with rails + angular js

Why I call it’s awesome ●  Rich javascript ●  Client-side develop ●  Single-page application

Page 3: Awesome web apps with rails + angular js

Approachs

Designer

Developer

Model/ API

HTML

Page 4: Awesome web apps with rails + angular js

jQuery

•  Library

•  Design a page, and then you make it dynamic

AngularJS

•  Framework

•  Design your application in ‘Angular way’

•  Should only do DOM manipulation in a directive - extensions of HTML

http://net.tutsplus.com/tutorials/javascript-ajax/5-awesome-angularjs-features/

jQuery & AngularJS can work together, but we should stop using jQuery, try to think about how to do in Angular way

different in approachs

Page 5: Awesome web apps with rails + angular js

Techniques

HTML, CSS, JS(UI)

JS Framework

Rest API

Database

Bootstrap

AngularJS

Rails

Postgres

Page 6: Awesome web apps with rails + angular js

Goals •  Write app in simple way •  App is compiled & minified automatically •  Easy to manage packages/ assets

JS

HTML

Coffee

Haml

Organize your app

Page 7: Awesome web apps with rails + angular js

Organize your app We had rails folder structure like this

/app

..assets

../controllers

../models

../views

../helpers

/public

...

Page 8: Awesome web apps with rails + angular js

How others do

Un-compiled Angular app

Packages/ assets 3rd tools

Compiled Angular app

3rd tools

/app

..assets

../controllers

../models

../views

../helpers

/public

...

Rails app Angular App

Page 9: Awesome web apps with rails + angular js

and how I do /app

--/assets

----/javascripts

------/controllers

--------/<module>/<Action>Ctrl.js.coffee

--------/<module>.js.coffee.erb

----/templates

------/<module>/<action>.html.haml

...

/public

...

●  Use rails to compile app ●  More simple, don’t use

extra tools, less build step, minification included

Page 10: Awesome web apps with rails + angular js

Result

Page 11: Awesome web apps with rails + angular js

https://developers.google.com/webmasters/ajax-crawling/