jeff-collins / ment.io

Mentions and Macros for Angular
http://jeff-collins.github.io/ment.io
MIT License
1.13k stars 221 forks source link

Ment.io retriving the selected mentions #196

Open nirmalrepo opened 7 years ago

nirmalrepo commented 7 years ago

How can I get all the selected mentions from a text area

iooops commented 6 years ago

I want to know the answer, too..

guille-alibrate commented 4 years ago

Currently, I'm doing:

mentio-select="selectItem(item)"

and

$ctrl.selectItem = function (obj) {
      // do something here to store your object in an array or something
      return obj.label
    }

However, I still don't know how to clean the array if the user deletes de mention. I'm thinking about checking the text context to find every single mention before submitting the for content.

MohammedMubeen commented 3 years ago

@guille-alibrate

how to clean the array if the user deletes de mention? did you found any solution.

My code:

$scope.getSuggestionText = function (item) { if (item.Name != undefined) { $rootScope.SuggestionTags.push({ Name: item.Name, ID: item.ID, Email: item.Email, Initials: item.Initials, Type: item.Type }); return '@' + item.Name + ''; } };