Upload
silicon-straits-saigon
View
1.498
Download
0
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
Rails + AngularJS
Awesome web apps with
o0khoiclub0o
Why I call it’s awesome ● Rich javascript ● Client-side develop ● Single-page application
Approachs
Designer
Developer
Model/ API
HTML
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
Techniques
HTML, CSS, JS(UI)
JS Framework
Rest API
Database
Bootstrap
AngularJS
Rails
Postgres
Goals • Write app in simple way • App is compiled & minified automatically • Easy to manage packages/ assets
JS
HTML
Coffee
Haml
Organize your app
Organize your app We had rails folder structure like this
/app
..assets
../controllers
../models
../views
../helpers
/public
...
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
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
Result
https://developers.google.com/webmasters/ajax-crawling/