amitava82 / angular-multiselect

[NOT MAINTAINED]Native AngularJS multiselect directive
http://amitava82.github.io/angular-multiselect
MIT License
140 stars 124 forks source link

Fixes for issues - #94 #95 #92 and made path to multiselect.tmpl.html relative #96

Open NithinBiliya opened 7 years ago

NithinBiliya commented 7 years ago

File changed - multiselect.js

Fix for issues -

  1. single select - button text is not mapped correctly to the string modal value #95
  2. single select - button text is not mapped correctly to the model value #94
  3. Show only one property but select complete object #92
  4. Made the path to multiselect.tmpl.html relative to multiselect.js in file multiselect.js. - Solution from -- http://stackoverflow.com/a/21103831/1298824

Changes made -

  1. Added a new function - getItemLabel(items,model)

  2. Calling the above function in function getHeaderText()

  3. get the currentScriptPath // getting the path of the multiselect.js file var scripts = document.getElementsByTagName("script") var currentScriptPath = scripts[scripts.length-1].src;

  4. Used the currentScriptPath as below - templateUrl: function (element, attr) { // multiselect.tmpl.html path relative to multiselect.js return attr.templateUrl || currentScriptPath.substring(0, currentScriptPath.lastIndexOf('/') + 1)

    • 'multiselect.tmpl.html'; },

Plnkr link after fixes - link3

amitava82 commented 7 years ago

Thanks! Can you update the readme, github pages with new changes?

NithinBiliya commented 7 years ago

Looks like last few pulls were into master branch. gh-pages branch is not in sync with the master. Its missing few updates.