Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including the angular element like ng-click on the dropdown #94

Open
kovurivinay opened this issue Jun 25, 2019 · 0 comments
Open

Including the angular element like ng-click on the dropdown #94

kovurivinay opened this issue Jun 25, 2019 · 0 comments

Comments

@kovurivinay
Copy link

kovurivinay commented Jun 25, 2019

the renderItem returns certain elements to populate in the dropdown. How to include ng-click in each element of that dropdown? This is not working as it's not being compiled into a angular DOM.

Can you provide me a solution?

`$("#cmd-input").autoComplete({
minChars: 1,
delay: 5,
cache:false,
source: function(term, suggest){
var autoComplete = //code to get options
var matches = autoComplete.choices;
suggest(matches);
},
renderItem: function (item, search) {
var re = new RegExp("(" + search.replace(/[-/\$^*+?.()|[]{}]/g, '\$&').split(' ').join('|') + ")", "gi");

How to include and implement angular event handlers like ng-click in the below ret element

	    var ret = '<div data-toggle="tooltip" data-placement="bottom" title="' + item.text + '" class="autocomplete-suggestion" data-val="' + item.text + '">'+
            '<div style="float:left" ');
	    ret += "</div>"


	    return ret;
	}
});`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant