Skip to content

Instantly share code, notes, and snippets.

@waynehoover
Created September 18, 2013 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waynehoover/6603986 to your computer and use it in GitHub Desktop.
Save waynehoover/6603986 to your computer and use it in GitHub Desktop.
App.config([
'$routeProvider'
'$locationProvider'
'$httpProvider'
($routeProvider, $locationProvider, $httpProvider, config) ->
$httpProvider.defaults.headers.common['X-CSRF-Token'] = $('meta[name=csrf-token]').attr('content');
$routeProvider
.when '/checkout',
templateUrl: '/partials/checkout'
controller: ($http, $scope) ->
$.getScript '//js.stripe.com/v2/', ->
Stripe.setPublishableKey($('meta[name=stripe-pub]').attr('content'))
.otherwise({redirectTo: '/home'})
# Without server side support html5 must be disabled.
$locationProvider.html5Mode(true)
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment