Comments (8)
hi @ozairabbas ,
May I know which minifier did you use? Have you tried to use http://jscompress.com?
from angular-multi-select.
I just ran into the same problem, I'm using the ASP.NET web optimizations minification and bundling package (MVC5), I've included dozens of other angular libraries and they all seem to work fine, keeps giving an error on 'prevTabIndex', any ideas? Just skimming through thr code for thr directive it seems to be written minification safe.
from angular-multi-select.
This is peculiar, I just ran a small test with the same asp.net minifier and everything worked fine, I'll take another look at it when I get home.
from angular-multi-select.
I've manually checked the code.. looks ok to me. I suggest to minify it manually if possible.
Btw make sure that you get the latest version.
from angular-multi-select.
Just to add that I'm also using ASP.NET minification (System.Web.Optimization) and I have 0 problems with this component. It's probably some of the JS components that you are using that's causing the problem - I've had quite few issues when combining Jquery, angular and different angular components in single bundles (some just don't play nicely with each other).
from angular-multi-select.
There IS a slight problem though, I just figured it out. I was bundling this directive along with my own scripts, and I always code in <strict mode>
, that in combination with some poor formatting in the directive code was making the bundler unhappy, inspecting the network request for the bundle I noticed this:
Minification failed. Returning unminified contents.
(760,25-37): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: prevTabIndex
(756,21-33): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: prevTabIndex
(777,25-37): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: prevTabIndex
(773,21-33): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: prevTabIndex
(738,21-24): run-time error JS1294: Strict-mode does not allow ++ or -- on certain objects: ctr
(735,17-20): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: ctr
(710,13-28): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: genRandomString
(694,33-37): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: temp
(669,17-28): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: helperIndex
(634,17-27): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: targetsArr
(614,25-42): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: helperItemsLength
(611,31-32): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: i
(611,100-101): run-time error JS1294: Strict-mode does not allow ++ or -- on certain objects: i
(596,21-38): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: helperItemsLength
(595,21-32): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: helperItems
(551,17-26): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: clickedEl
(492,29-32): run-time error JS1294: Strict-mode does not allow ++ or -- on certain objects: ctr
(466,17-20): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: ctr
(424,17-29): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: prevTabIndex
(349,49-64): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: inputModelIndex
(355,49-64): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: inputModelIndex
(368,49-64): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: inputModelIndex
(375,49-64): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: inputModelIndex
(417,21-36): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: inputModelIndex
(290,17-22): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: index
(135,13-30): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: helperItemsLength
(134,13-24): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: helperItems
(133,13-25): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: prevTabIndex
The code is riddled with implicitly defined variables, Tbh I personally never understood this practice, I mean your code will most probably work fine but Jesus it will look hideous. Inspecting the JsHint warnings in Visual Studio gives you more of an insight, for example:
<Assignment to an implictly declared global variable genRandomString>
.
In my case the 2 workarounds were:
- Stop using
<strict-mode>
. - Clean up the few global variables, and scoping issues.
I opted the latter, only took about 5/6 minutes thanks to JsHint.
HTH.
from angular-multi-select.
Hi @ElDuderino87 ,
Thanks for pointing this out. Will consider using strict mode for the next release.
from angular-multi-select.
@isteven You're most welcome. Thank you for the awesome directive :).
from angular-multi-select.
Related Issues (20)
- How to add tooltip for each dropdown element? HOT 9
- how to add default text when data is not bound to multiselect? HOT 1
- Reset doesn't set all values' 'ticked' property to false HOT 2
- output-model needn't be a compulsory attribute HOT 4
- Is there any angular 4 version of this available ? HOT 2
- Use same input-model to multiple multiselectors? HOT 4
- Select items from single group only
- XSS attack by option name
- Mutli select not support direction
- how to select all items loaded on the control??
- How to prevent .length == 'undefined' error when populating dropdown via on-open
- Filtering problem when grouped
- Grouping
- Issue injecting multi-select directive into another directive with same scope
- make filter clear button 'x' icon encoded
- Possible to launch dropdown from custom button?
- will it be possible to give remove option to the selected items in the ui HOT 1
- Search not working when grouping is enabled.
- Any ways to dynamically update helper-elements?
- Multiple elements selected when only one is clicked HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-multi-select.