Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
'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