Skip to content

Instantly share code, notes, and snippets.


gdyrrahitis/routes.ts Secret

Created Jul 13, 2018
What would you like to do?
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) => {
let home = config.client.routes.find(v => v.controller === "homeController");
let department = config.client.routes.find(v => v.controller === "departmentController");
.when(home.path, {
templateUrl: home.templateUrl,
controller: home.controller
.when(department.path, {
templateUrl: department.templateUrl,
controller: department.controller
redirectTo: config.client.basePath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment