- goldMINE!!!

-location reference fixed
This commit is contained in:
Matan Bar Yosef 2015-06-29 21:01:30 +03:00
parent 23e8780dd6
commit ab35e946c0
4 changed files with 12 additions and 12 deletions

View file

@ -54,7 +54,7 @@ app.config(['$routeProvider', '$locationProvider',
templateUrl: 'templates/views/newTask.html',
controller: 'newTasksController'
})
.when('/class/:projectId', {
.when('/class/:classId/:className', {
templateUrl: 'templates/views/class.html',
controller: 'classController'
})

View file

@ -2,19 +2,18 @@ angular.module('SeHub')
.controller('classController', ['$scope', '$routeParams', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $routeParams, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
{
var token = $cookies['com.sehub.www'];
var classId = $routeParams.projectId;
// var projectId = "";
var classId = $routeParams.classId;
$scope.project = {};
$scope.project.courseName = $routeParams.className;
$scope.projectsEmpty = true;
$scope.isCreateProjectClicked = false;
$scope.submitNewCourseClicked = false;
$scope.project = {};
$scope.loadingData = true;
$scope.isInCourse = false;
$scope.project.courseName = classId;
$scope.displayProjects = function()
{
console.log("in displayProjecs!!! ");
apiService.getProjectsByCourse(token, classId).success(function(data) // Get all the campuses
{
$scope.loadingData = false;

View file

@ -15,10 +15,10 @@ angular.module('SeHub')
$scope.campusId;
var campusId = $routeParams.campusId;
$scope.goToClass = function(classId)
$scope.goToClass = function(classId, className)
{
console.log("Done! " + $scope.courses);
$location.path('/class/' + classId.toString()); // Will display all the projects in this course
console.log("Done! " + className);
$location.path('/class/' + classId.toString() + '/' + className); // Will display all the projects in this course
}
$scope.chooseCampusClicked = function()
@ -82,7 +82,8 @@ 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() {
$location.path('/newCourse'); // TODO TODO TODO
// $location.path('/newCourse'); // TODO TODO TODO
$location.path('/class/' + data.id + '/' + data.courseName); // Will display all the projects in this course
}); // Pop-up alert
}).error(function(err)
{

View file

@ -7,7 +7,7 @@
<div flex = "32" layout = "column" ng-repeat = "course in t" value = "{{course}}" >
<div ng-if = "!scope.coursesEmpty">
<div ng-if="t.length != 1">
<md-button ng-click = "goToClass(course.id)" style="width:100%; height:32%;" layout-padding class = "md-raised" >
<md-button ng-click = "goToClass(course.id, course.courseName)" style="width:100%; height:32%;" layout-padding class = "md-raised" >
<div style="width:97%;height:97%">
<md-card-content>
<h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" -->
@ -16,7 +16,7 @@
</md-button>
</div>
<div ng-if="t.length == 1">
<md-button ng-click = "goToClass(course.id)" style="width:32%; height:32%;" layout-padding class = "md-raised" >
<md-button ng-click = "goToClass(course.id, course.courseName)" style="width:32%; height:32%;" layout-padding class = "md-raised" >
<div style="width:97%;height:97%">
<md-card-content>
<h2 class="md-title">{{course.courseName}}</h2> <!-- Should Be "course.title" -->