Skip to content

Instantly share code, notes, and snippets.

@slattery
Forked from Sebmaster/Ctrl.js
Created October 3, 2013 01:13
Show Gist options
  • Save slattery/6803088 to your computer and use it in GitHub Desktop.
Save slattery/6803088 to your computer and use it in GitHub Desktop.
angular.module('MyApp', ['racer.js']).
config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
//$locationProvider.html5Mode(true);
$routeProvider.
when('/', { templateUrl: 'partials/home.htm', controller: IndexCtrl, resolve: IndexCtrl.resolve })
otherwise({redirectTo: '/'});
}]);
function Ctrl($scope, model) {
// model is exactly a racerjs model. See http://derbyjs.com/#model_features for details.
}
Ctrl.resolve = {
model: function (racer) {
return racer;
}
};
Ctrl.resolve.model.$inject = ['racer'];
Ctrl.$inject = ['$scope', 'model'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment