ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

General comment about angular libraries / plugins.

Open jklaus opened this issue 12 years ago • 3 comments

I've noticed that in the majority of angular libraries/plugins people are not using angular or jQuery methods for things. This causes inconsistent behavior across browsers, especially for those of us stuck in older browsers. An example of this is in the export plugins for ng-grid they are using for(x in y), y being an array. In older browsers such as IE8 a for written in this fashion will iterate through all of the elements of the array as well as the properties of said array. I realize that this specific example is not the best b/c the export plugin also utilizes html download which is not supported in IE8, but setting the standard to use angular/jQuery methods in place of straight javascript methods needs to happen. Of course if this were a stand alone library, not associated with Angular, and there by jQuery, then I would advise against building in such dependencies. Given its soul purpose is to work with Angular and Angular/jQuery are providing and supporting functionality in all browsers, why would you not use it?

jklaus avatar May 08 '14 14:05 jklaus

angular 1.2 and above no longer supports IE 8, and we're following that path.

There is just no way to support older browsers with the amount of work and time it takes. It cannot be done unless someone with the cash wants to step in and do it.

Sorry that you're stuck, especially given the latest exploits you won't be getting patches for. ng-grid is probably the least of your problems now :( On May 8, 2014 9:02 AM, "jKlaus" [email protected] wrote:

I've noticed that in the majority of angular libraries/plugins people are not using angular or jQuery methods for things. This causes inconsistent behavior across browsers, especially for those of us stuck in older browsers. An example of this is in the export plugins for ng-grid they are using for(x in y), y being an array. In older browsers such as IE8 a for written in this fashion will iterate through all of the elements of the array as well as the properties of said array. I realize that this specific example is not the best b/c the export plugin also utilizes html download which is not supported in IE8, but setting the standard to use angular/jQuery methods in place of straight javascript methods needs to happen. Of course if this were a stand alone library, not associated with Angular, and there by jQuery, then I would advise against building in such dependencies. Given its soul purpose is to work with Angular and Angular/jQuery are providing and supporting functionali ty in all browsers, why would you not use it?

— Reply to this email directly or view it on GitHubhttps://github.com/angular-ui/ng-grid/issues/1176 .

c0bra avatar May 08 '14 16:05 c0bra

I went with DataTables (using TableTools) so it wasn't really an issue for me - I'm just curious if you're writing a library specific to Angular, why would you not use functionality like Angular.forEach over a standard for( x in y).

jklaus avatar May 08 '14 17:05 jklaus

I can't speculate on why the plugin author chose that method. Personally, I've been using native forEach and regular for loops for performance reasons: http://jsperf.com/angular-foreach-vs-native-for-loop/3

c0bra avatar May 08 '14 17:05 c0bra