akserg / ng2-toasty

Angular2 Toasty component shows growl-style alerts and messages for your app.
MIT License
283 stars 102 forks source link

'Observable<{}>' is not assignable to type 'Observable<ToastData> under beta 13 and zone 0.6.8 #6

Closed mburger81 closed 8 years ago

mburger81 commented 8 years ago

Hey, using ng2-toasty 1.3.0 with angular2 beta.13 and zone 0.6.8 I get this error

node_modules/ng2-toasty/src/toasty.service.ts:59:8 
Type 'Observable<{}>' is not assignable to type 'Observable<ToastData>'.
  Type '{}' is not assignable to type 'ToastData'.
    Property 'id' is missing in type '{}'.
akserg commented 8 years ago

I will update it only today. Let you know.

taohd commented 8 years ago

any updates on this? possible issue with rxjs@5.0.0-beta.2 which angular2 beta.13 still has a dependency on. notice your project was using rxjs@5.0.0-beta.4

taohd commented 8 years ago

just needed to type the Observable in toasty.service.ts this.toastsObservable = new Observable<ToastData>((subscriber:Subscriber<ToastData>) => { this.toastsSubscriber = subscriber;

akserg commented 8 years ago

Sorry, I tested the component with following combinations and didn't find any issues:

Here is the Plunker's link you can use for tests: http://embed.plnkr.co/5aQl8L.

I'm ready to help you. Is that possible to some how share the project, source code, package.json and etc.

mburger81 commented 8 years ago

@akserg I think this is not a issue but iats a TSlint limitation? Do you use latest angular2-webpack-starter there you can see the "issue".

On change code to this.toastsObservable = new Observable<ToastData>((subscriber:Subscriber<ToastData>) => { in line 59 this resloves the tslint error

thx Michael

akserg commented 8 years ago

Fixed in release 1.4.1 available on https://www.npmjs.com/package/ng2-toasty