angularjs - How to register the event in $scope using handlebar in twitter typeahead -


i using latest twitter typeahead using custom templates using angularjs.

i able desired output have button in custom templates appears when enter in dropdown.

enter image description here

here plunker : http://plnkr.co/edit/u5zkxhry0bcu6u5r0wup?p=preview

now when click on add button event not getting fired. think event not getting registered in $scope. how can on here ?

$('#prependedinput').typeahead({             hint: true,             highlighter: function (x) { return x; },             minlength: 3,         },         {             name: 'members',             displaykey: 'value',             source: getusersearchdata,             templates: {                 suggestion: handlebars.compile('{{member}}')             }         });          handlebars.registerhelper('member', function (items) {             var item = this;             var items = '<li><a><div class="row"><img style="height: 40px; float:left" src=' + getavatarurl(item) + ' /><span style="padding: 0.5em; float:left;"> ' + getdisplayname(item) + '</span><button class="btn btn-sm pull-right" ng-click="confirmadddialog(' + item.id + ')">add</button></div></a></li>';             return new handlebars.safestring(items)         }); 

i have 1 function fire modal popup.

$scope.confirmadddialog = function (userid) {             flashsvc.add('we hit...');          }; 

how can register event using template.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -