-
-
Save gdyrrahitis/8329cc84e6a862d1b26719599956fc7e to your computer and use it in GitHub Desktop.
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 config: AppConfig.Configuration = require("./app.config.json!"); | |
import "angular"; | |
export function registerRoutesFor(app: angular.IModule) { | |
"use strict"; | |
app.config(($routeProvider: angular.route.IRouteProvider, $locationProvider: angular.ILocationProvider) => { | |
$locationProvider.html5Mode(config.client.html5Mode); | |
let home = config.client.routes.find(v => v.controller === "homeController"); | |
let department = config.client.routes.find(v => v.controller === "departmentController"); | |
$routeProvider | |
.when(home.path, { | |
templateUrl: home.templateUrl, | |
controller: home.controller | |
}) | |
.when(department.path, { | |
templateUrl: department.templateUrl, | |
controller: department.controller | |
}) | |
.otherwise({ | |
redirectTo: config.client.basePath | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment