jakiestfu / Mention.js

Lightweight wrapper for adding @user mention functionality to Twitter Bootstraps Typeahead plugin
http://jakiestfu.github.com/Mention.js/
MIT License
747 stars 144 forks source link

Fix for dirty users array (inherited properties) #32

Closed radiantnode closed 4 years ago

radiantnode commented 9 years ago

I came across a bug when implementing Mention.js in an Angular application. Sometimes data objects provided by Angular will include inherited methods like forEach in the array of items. When I would pass this user array to Mention.js it would iterate over the inherited methods and try and render them. Adding a simple hasOwnProperty check fixes this.