Last active
August 29, 2015 14:24
-
-
Save folivi/4c0402750325f8553eae to your computer and use it in GitHub Desktop.
ngRoute & rails
This file contains hidden or 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 = angular.module('Sports', [ | |
'ngRoute', 'ngResource' | |
]) | |
@app.config ($routeProvider, $locationProvider) -> | |
$locationProvider.html5Mode | |
enabled: true | |
requireBase: false | |
$routeProvider | |
.when '/sports/:id', | |
controller: 'sportsCtrl' | |
@app.config([ | |
'$httpProvider', ($httpProvider)-> | |
$httpProvider.defaults.headers.common['X-CSRF-Token'] = $('meta[name=csrf-token]') | |
]) | |
@app.run(-> | |
console.debug 'angular running' | |
) |
This file contains hidden or 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
//= require jquery | |
//= require jquery_ujs | |
//= require angular | |
//= require angular-app/app | |
//= require_tree ./angular-app/controllers | |
//= require angular-route | |
//= require angular-resource | |
//= require bootstrap | |
// require_tree . |
This file contains hidden or 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.controller "sportsCtrl", ($scope, $routeParams, $route, $resource)-> | |
console.debug $routeParams.id | |
console.debug $route |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment