diff --git a/home.html b/home.html index 944ef78..3ee4c9e 100644 --- a/home.html +++ b/home.html @@ -4,6 +4,8 @@
+ + @@ -32,7 +34,7 @@ - + diff --git a/scripts/ClassAddController.js b/scripts/ClassAddController.js index ecd64ef..6fc0130 100644 --- a/scripts/ClassAddController.js +++ b/scripts/ClassAddController.js @@ -1,22 +1,27 @@ angular.module('flashy.ClassAddController', ['ui.router', 'angucomplete-alt', 'ngMaterial']). - controller('ClassAddController', ['$scope', '$state', '$http', function($scope, $state, $http) { + controller('ClassAddController', ['$scope', '$state', '$http', function ($scope, $state, $http) { - $scope.trySearch = function() { - return $http.get('/api/sections/search').then(function(response){ - return response.data; - })}; + $scope.trySearch = function (searchText) { + return $http.get('/api/sections/search/', { + params: { + q: searchText + } + }).then(function (response) { + return response.data; + }) + }; $scope.searchText = ""; /*$scope.trySearch = function() { - $http.get('/api/sections/search', [$scope.searchText]). - success(function(data) { - return data; - }). - error(function(err) { - console.log('you eejit'); - }); - };*/ + $http.get('/api/sections/search', [$scope.searchText]). + success(function(data) { + return data; + }). + error(function(err) { + console.log('you eejit'); + }); + };*/ }]); diff --git a/templates/addclass.html b/templates/addclass.html index 06a4f64..6b33731 100644 --- a/templates/addclass.html +++ b/templates/addclass.html @@ -1,19 +1,22 @@ -