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.
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 simplehasOwnProperty
check fixes this.