ngTagsInput icon indicating copy to clipboard operation
ngTagsInput copied to clipboard

feat(tagsInput): Add track-by-expr option

Open zhouzi opened this issue 8 years ago • 6 comments

I've added a track-by-expr option that allows using a custom expression for tracking tags. This way you can do whatever you want to handle the ng-repeat's track by.

I've also made a few changes to the canAdd and track functions so they are more consistent. Until now, canAdd would consider foo and Foo to be the same value while the track by wouldn't. It was also possible to introduce duplicate values with invalid text such as null and undefined.

zhouzi avatar Feb 22 '16 19:02 zhouzi

How can I download this?

manar-mk avatar Apr 07 '16 10:04 manar-mk

Since this PR is not merged yet, you can get the code from the wizbii/ngTagsInput repository. It then depends on how you are tracking your dependencies but you can also npm install wizbii/ngTagsInput --save. Note that the repository doesn't contain the generated files so you'll have to build it yourself. To do so, you'll need to:

  1. Get the code
  2. cd ngTagsInput
  3. npm install grunt-cli -g
  4. npm install
  5. grunt pack:js

You will end up with a "build" folder that contains the javascript files. Let me know if you're having trouble going through this process and I'll see if I can get you a link to the minified version.

zhouzi avatar Apr 07 '16 23:04 zhouzi

thanks for such a fast reply. Could you please give me the link for minified version. Cause of the Windows OS I've faced some permission errors with the last step

manar-mk avatar Apr 08 '16 04:04 manar-mk

Here you go: jsfiddle.net/exbvfs7g (grab the code from the javascript panel). You can give it a try in this example by adding "design".

zhouzi avatar Apr 08 '16 10:04 zhouzi

Thank you Gabin. It helped me a lot)

manar-mk avatar Apr 08 '16 11:04 manar-mk

:+1: We definitely need this. @mbenford any chance you can merge this PR ?

ddolcimascolo avatar Jun 28 '16 14:06 ddolcimascolo