refactored input search directive to expose the controller to other components services