[Search] Documentation

More specific descriptions of angular scope
variables in searchcontroller.
This commit is contained in:
slhale 2015-08-17 10:33:10 -07:00
parent 80c99d2eb6
commit 2ef0c2a8cb

View File

@ -31,18 +31,26 @@ define(function () {
LOAD_INCREMENT = 20; LOAD_INCREMENT = 20;
function SearchController($scope, searchService, types) { function SearchController($scope, searchService, types) {
// Starting amount of results to load. Will get increased. // numResults is the starting amount of results to load. Will get increased.
// fullResults holds the most recent complete searchService response object
var numResults = INITIAL_LOAD_NUMBER, var numResults = INITIAL_LOAD_NUMBER,
fullResults = {hits: []}; fullResults = {hits: []};
// Scope variables are: // Scope variables are:
// results, types, loading, filtersString, // results, an array of searchResult objects
// ngModel.input, ngModel.search, ngModel.checked // types, an array of type objects
// loading, whether search() is loading
// filtersString, a string list of what filters on the results are active
// ngModel.input, the text of the search query
// ngModel.search, a boolean of whether to display search or the tree
// ngModel.checked, a dictionary of which type filter options are checked
// ngModel.checkAll, a boolean of whether all of the types in ngModel.checked are checked
$scope.types = []; $scope.types = [];
$scope.ngModel.checked = {}; $scope.ngModel.checked = {};
$scope.filtersString = ''; $scope.filtersString = '';
$scope.loading = false; $scope.loading = false;
// Filters searchResult objects by type. Allows types that are // Filters searchResult objects by type. Allows types that are
// checked. (ngModel.checked['typekey'] === true) // checked. (ngModel.checked['typekey'] === true)
function filter(hits) { function filter(hits) {