JanStevens / angular-growl-2

growl-like notifications for angularJS projects
MIT License
285 stars 97 forks source link

Angular 1.3 compatibility fix #20 breaks 1.2.x #28

Closed pgaertig closed 10 years ago

pgaertig commented 10 years ago

I have got an issue with angular-growl-2 master and my app which fatally breaks all http stuff in Angular 1.2.16 up to .21. Fortunately it also happens with demo/demo.html page. The growl doesn't work and after opening the page the browser console logs the following:

TypeError: object is not a function
at v.splice.response (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:73:225)
at u (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:97:280)
at u (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:97:280)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:98:417
at h.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:108:482)
at h.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:106:62)
at h.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:109:287)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:18:23
at Object.d [as invoke] (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:34:265)
at $b.c (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:17:439) angular.js:9778
Error: [$compile:tpload] http://errors.angularjs.org/1.2.16/$compile/tpload?p0=templates%2Fgrowl%2Fgrowl.html
at Error (<anonymous>)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:6:450
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:59:506
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:71:79
at F (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:97:351)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:99:51
at h.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:108:482)
at h.$digest (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:106:62)
at h.$apply (https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:109:287)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js:18:23 angular.js:9778

The problem is caused by c5b5a89647f683f9ace0fa67739e5d3ba445c637 introduced by #20 fix. Angular 1.3 API requires objects in interceptor mechanics however 1.2.x still needs a function. The template loading error is caused by malfunctioning interceptor.

pgaertig commented 10 years ago

That may help someone: pin angular-growl-v2 to 0f71446dd3632234bdc0b9f050dcb20e86213179 in your bower.json to have this awesome lib working back with 1.2.x.

vik-singh commented 10 years ago

Oh whoa - I could've sworn I tested this in 1.2.x and it worked fine. Anyway @JanStevens - how do you want to handle this? Should we create an Angular 1.3 branch and leave master compatible with 1.2? Or the other way around and have a 1.2 branch?

pgaertig commented 10 years ago

@vik-singh you did the good job. I investigated the issue and indeed 1.2.x deprecates old notation. Your change should work with 1.2.x. The trap is in demo.html and README which present the old way of registering the interceptor via responseInterceptor. It is hard to notice by anybody what is the problem.

pgaertig commented 10 years ago

29 fixes the issue so I am closing this one.