forked from 18F/fedramp-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.component.js
62 lines (55 loc) · 1.43 KB
/
search.component.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
(function () {
'use strict';
angular
.module('fedramp.components')
.component('search', {
templateUrl: 'templates/components/search.html',
controller: Search,
controllerAs: 'controller'
});
Search.$inject = ['$log', '$state'];
/**
* @constructor
* @memberof Components
*/
function Search ($log, $state) {
var self = this;
/**
* The format to be used when rendering results in Bing.
* For browsers where AngularJS does not work we would want
* normal functionality.
*
* @member {string}
* @memberof Components.Search
*/
self.format = 'html';
/**
* The search query.
*
* @member {string}
* @memberof Components.Search
*/
self.query = '';
/**
* Redirect to the search view to handle rendering of results
*
* @public
* @memberof Components.Search
*/
self.search = function (e) {
if (e) {
e.preventDefault();
}
if (self.query) {
$state.go(
'fedramp.app.search',
{
query: self.query,
},
{
reload: true
});
}
};
}
})();