From 5466ce78f00038e742ef2a108c755f57ede451f5 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Sun, 24 Jan 2016 19:19:32 +0100 Subject: Add angular-route --- client/js/app.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'client/js/app.js') diff --git a/client/js/app.js b/client/js/app.js index 63ecfef..7fedb32 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -1,3 +1,18 @@ // Declare main app -var mainApp=angular.module("mainApp",[]); \ No newline at end of file +var mainApp=angular.module("mainApp",['ngRoute']); + + +mainApp.config(['$routeProvider', function($routeProvider){ + $routeProvider. + when('/home',{ + templateUrl: 'partials/home.html', + controller: 'homeCtrl' + }). + when('/network',{ + templateUrl: 'partials/network.html', + controller: 'networkCtrl' + }).otherwise({ + redirectTo: '/home' + }); +}]); \ No newline at end of file -- cgit v1.2.3