Skip to content

Instantly share code, notes, and snippets.

@zymtx5g79k
Created October 3, 2016 05:04
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 zymtx5g79k/616f6e0380a29401743368b4f6052196 to your computer and use it in GitHub Desktop.
Save zymtx5g79k/616f6e0380a29401743368b4f6052196 to your computer and use it in GitHub Desktop.
'use strict';
app = angular.module('app', [
'ngRoute',
'ngResource',
'templates',
'angularFileUpload'
])
app.config([ '$routeProvider', '$locationProvider', '$httpProvider',
($routeProvider, $locationProvider, $httpProvider) ->
$httpProvider.defaults.headers.common['X-CSRF-TOKEN'] = $('meta[name=csrf-token]').attr('content')
$routeProvider
.when("/"
templateUrl: "angular/templates/books/index.html"
controller: "BooksController"
mainPage: true
)
.when("/books"
templateUrl: "angular/templates/books/index.html"
controller: "BooksController"
mainPage: true
)
.when("/books/:bookId/edit"
templateUrl: "angular/templates/books/edit.html"
controller: "BooksController"
)
.when("/books/new"
templateUrl: "angular/templates/books/new.html"
controller: "BooksController"
)
$locationProvider.html5Mode(true)
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment