Commit 00d3d49a authored by Robert Knight's avatar Robert Knight

Convert `<search-input>` to a component

parent 2cbf1969
...@@ -146,6 +146,7 @@ module.exports = angular.module('h', [ ...@@ -146,6 +146,7 @@ module.exports = angular.module('h', [
.component('loginControl', require('./directive/login-control')) .component('loginControl', require('./directive/login-control'))
.component('loginForm', require('./directive/login-form').component) .component('loginForm', require('./directive/login-form').component)
.component('publishAnnotationBtn', require('./directive/publish-annotation-btn')) .component('publishAnnotationBtn', require('./directive/publish-annotation-btn'))
.component('searchInput', require('./directive/search-input'))
.component('searchStatusBar', require('./directive/search-status-bar')) .component('searchStatusBar', require('./directive/search-status-bar'))
.component('sidebarTutorial', require('./directive/sidebar-tutorial').component) .component('sidebarTutorial', require('./directive/sidebar-tutorial').component)
.component('shareDialog', require('./directive/share-dialog')) .component('shareDialog', require('./directive/share-dialog'))
...@@ -159,7 +160,6 @@ module.exports = angular.module('h', [ ...@@ -159,7 +160,6 @@ module.exports = angular.module('h', [
.directive('hOnTouch', require('./directive/h-on-touch')) .directive('hOnTouch', require('./directive/h-on-touch'))
.directive('hTooltip', require('./directive/h-tooltip')) .directive('hTooltip', require('./directive/h-tooltip'))
.directive('markdown', require('./directive/markdown')) .directive('markdown', require('./directive/markdown'))
.directive('searchInput', require('./directive/search-input'))
.directive('selectionTabs', require('./directive/selection-tabs')) .directive('selectionTabs', require('./directive/selection-tabs'))
.directive('sortDropdown', require('./directive/sort-dropdown')) .directive('sortDropdown', require('./directive/sort-dropdown'))
.directive('spinner', require('./directive/spinner')) .directive('spinner', require('./directive/spinner'))
......
...@@ -32,14 +32,10 @@ function SearchInputController($element, $http, $scope) { ...@@ -32,14 +32,10 @@ function SearchInputController($element, $http, $scope) {
}; };
} }
// @ngInject module.exports = {
module.exports = function () {
return {
bindToController: true,
controller: SearchInputController, controller: SearchInputController,
controllerAs: 'vm', controllerAs: 'vm',
restrict: 'E', bindings: {
scope: {
// Specifies whether the search input field should always be expanded, // Specifies whether the search input field should always be expanded,
// regardless of whether the it is focused or has an active query. // regardless of whether the it is focused or has an active query.
// //
...@@ -49,5 +45,4 @@ module.exports = function () { ...@@ -49,5 +45,4 @@ module.exports = function () {
onSearch: '&', onSearch: '&',
}, },
template: require('../templates/search_input.html'), template: require('../templates/search_input.html'),
};
}; };
...@@ -9,7 +9,7 @@ describe('searchInput', function () { ...@@ -9,7 +9,7 @@ describe('searchInput', function () {
before(function () { before(function () {
angular.module('app', []) angular.module('app', [])
.directive('searchInput', require('../search-input')); .component('searchInput', require('../search-input'));
}); });
beforeEach(function () { beforeEach(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment