SHARE
TWEET
Untitled
a guest
Oct 11th, 2016
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- angular.module('angularDemo.searchDirective',[])
- .directive('searchBar', searchDirective);
- function searchDirective() {
- function link(scope, elem, attrs) {
- var callback = function(event){
- console.log(event.target.value);
- };
- elem.bind("keydown keypress", _.debounce(callback, 300));
- }
- return {
- restrict: 'E',
- transclude: true,
- scope: {},
- template: '<form class="form-inline"><div class="form-group"><div class="input-group"><input type="text" class="form-control" ng-model="value" ng-model-options="{ updateOn: \'blur\' }" ng-change="" id="searchText" placeholder="(e.g.: jQuery)" /></div></div></form>',
- link: link
- };
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
