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

Store lists of objects that pass name attribute, rather than passing actual strings. #182

Open
CarbonComputed opened this issue Dec 7, 2013 · 2 comments

Comments

@CarbonComputed
Copy link

Why restrict pushing strings? Why not push a "tag" object. All other attributes on the tag can remain the same, but when displaying it access the tags name field. For example, opposed to doing
tag = privateMethods.trimTag(tag, opts.delimiterChars);
Do this:
tag.name = privateMethods.trimTag(tag.name, opts.delimiterChars);

I know I would use this because usually a tag represents more than just a name. A tag might have an json associated with it for example. I'm using a modified version of this plugin on my site and the tags represent tag models in my database. These have more attributes than just a string: description, image, etc. This could be useful for web applications that associate tags with attributed data plus a name, not just a string.

@noirbizarre
Copy link
Contributor

+1

It's really important because sometime we have to store IDs or other attributtes.

@johnnyshields
Copy link
Collaborator

Hi guys, as I've said in other threads if someone can raise a PR for this we'll accept it. Now that we've switched to Twitter Typeahead it should be more easily achieved than when we were on the legacy Bootstrap Typeahead.

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

3 participants