Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 1.3 and minimal required JQuery version

We have a huge system, developed fully with angular, from scratch (no non-angular legacy code, no other non-angular frameworks)

Shame on us, we are still working with angular 1.2.12 (!!) and an old JQuery version (1.8.3)

Recently I was assigned to migrate our system to work with latest stable angular (=1.3.14)

Surprisingly** enough, when briefed on angular's source code, I found the below remark (at the method: bindJQuery)

// Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older

// versions. It will not work for sure with jQuery <1.7, though.

(Surprisingly** = I could not find it mentioned in the formal migration guide from angular 1.2 to 1.3 nor at angular's change log... have I missed that ?)

As we currently have no plans (in terms of time and effort estimation) to migrate our JQuery version as well, I wanted to ask:

  • Does any one knows if there are any actual known bugs and pitfalls when trying to force angular 1.3 work with jQuery 1.8.3 ?
  • Are there any suspicious areas I should pay more attention in searching for errors and strange behavior ?
  • Is this something I should avoid from to begin with ?

Thanks a'head

like image 361
aviad cohen Avatar asked Oct 31 '22 08:10

aviad cohen


1 Answers

According to Angular's FAQ, Angular 1.3.x supports jQuery 2.1 and above. Here's what is says:

Does Angular use the jQuery library?

Yes, Angular can use jQuery if it's present in your app when the application is being bootstrapped. If jQuery is not present in your script path, Angular falls back to its own implementation of the subset of jQuery that we call jQLite.

Angular 1.3 only supports jQuery 2.1 or above. jQuery 1.7 and newer might work correctly with Angular but we don't guarantee that.

Yes, this doesn't give you an exact answer on what might be broken. But "might" and "don't guarantee" should give you a strong indication that Angular was not tested with < jQuery 2.1. In my book it is very bad.

like image 200
New Dev Avatar answered Nov 15 '22 05:11

New Dev