Created
July 28, 2015 19:34
-
-
Save enijar/d2b199dca09a08c3fee5 to your computer and use it in GitHub Desktop.
Angular Configuration File for Laravel
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
var app = angular.module('app', ['ngRoute']); | |
/** | |
* Define all routes and any global Angular scopes. | |
* | |
* Note: I am using the templateUrl property to refer to | |
* a URI for Laravel to pick up and serve, instead of | |
* loading a HTML file. This is a cleaner way to use | |
* templates with Angular and Laravel | |
*/ | |
app.config(function($routeProvider, $locationProvider) { | |
$routeProvider | |
.when('/', { | |
templateUrl: document.baseURI + 'templates/home', | |
controller: 'HomeController' | |
}); | |
$locationProvider.html5Mode(true); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment