Last active
August 29, 2015 14:21
-
-
Save trungv0/420334f4217932bc4ea2 to your computer and use it in GitHub Desktop.
angular in rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/angular_assets.rb | |
Rails.application.assets.register_engine('.haml', Tilt::HamlTemplate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/assets/javascripts/app.coffee.erb | |
#= depend_on_asset "templates/view.html" | |
... | |
module.config ($routeProvider, $locationProvider) -> | |
$routeProvider.when '/books', | |
templateUrl: '<%= asset_path "templates/books.html" %>', | |
controller: 'BooksController' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/assets/javascripts/application.js | |
//= require angular | |
//= require angular-resource | |
//= require angular-route |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'angularjs-rails' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment