Last active
May 30, 2017 22:57
-
-
Save byverdu/76cb9b41c2785bd9213c789bbe8837aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// app/client/js/router.js | |
const angular = require( 'angular' ); | |
require( 'angular-route' ); | |
require( './controllers/homeModule' ); | |
require( './controllers/imdbModule' ); | |
angular.module( 'imdbApp', ['ngRoute', 'homeModule', 'imdbModule']) | |
.config(['$routeProvider', '$locationProvider', ( $routeProvider, $locationProvider ) => { | |
$locationProvider.html5Mode( true ); | |
$routeProvider.when( '/', { | |
controller: 'HomeController', | |
templateUrl: 'views/home' | |
}); | |
$routeProvider.when( '/imdb/:collection', { | |
controller: 'ImdbController', | |
templateUrl: 'views/imdb' | |
}); | |
$routeProvider.when( '/imdb/:collection/:id', { | |
controller: 'ImdbController', | |
templateUrl: 'views/item' | |
}); | |
$routeProvider.otherwise({ | |
redirectTo: '/' | |
}); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment