From 163a711f0fc9e3b65e7bbe7331a7c4671ca2cc73 Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Sat, 27 Jun 2015 14:52:49 +0300 Subject: [PATCH] - Create Class reference - fixed --- templates/js/controllers/myClassesController.js | 5 +++-- templates/js/controllers/newCourseController.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/js/controllers/myClassesController.js b/templates/js/controllers/myClassesController.js index e1f7fa1..ccabe30 100644 --- a/templates/js/controllers/myClassesController.js +++ b/templates/js/controllers/myClassesController.js @@ -1,5 +1,6 @@ angular.module('SeHub') -.controller('myClassesController', ['$scope', '$location', '$routeParams', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $location, $routeParams, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) +.controller('myClassesController', ['$scope', '$location', '$routeParams', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', + function ($scope, $location, $routeParams, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) { $scope.isStudent = false; $scope.isCourse = false; @@ -85,7 +86,7 @@ angular.module('SeHub') $mdDialog.show($mdDialog.alert().title('Course Created').content('You have created course successfully.') .ariaLabel('Email verification alert dialog').ok('Lets Start!').targetEvent()) .then(function() { - $window.location.href = 'templates/views/newCourse.html'; // TODO TODO TODO + $location.path('/newCourse'); // TODO TODO TODO }); // Pop-up alert }).error(function(err) { diff --git a/templates/js/controllers/newCourseController.js b/templates/js/controllers/newCourseController.js index 3eccaea..f330cdf 100644 --- a/templates/js/controllers/newCourseController.js +++ b/templates/js/controllers/newCourseController.js @@ -1,8 +1,9 @@ angular.module('SeHub') -.controller('newCourseController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) +.controller('newCourseController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', + function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) { $scope.goBack = function() { - $window.location.href = 'templates/views/myClasses.html'; + $location.path('/myClasses'); } }]); \ No newline at end of file