2.1.1 still error incorrectly implements interface 'Resolve<SignalRConnection>'
See original GitHub issue@Injectable() export class SignalRConnectionResolve implements Resolve<SignalRConnection> { constructor(private _signalR: SignalR) { } resolve() { console.log(‘SignalRConnectionResolve. Resolving…’); return this._signalR.connect(); } }
incorrectly implements interface 'Resolve<SignalRConnection>'. Types of property 'resolve' are incompatible. Type '() => Promise<ISignalRConnection>' is not assignable to type '(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => SignalRConnection | Observable<Sig...'. Type 'Promise<ISignalRConnection>' is not assignable to type 'SignalRConnection | Observable<SignalRConnection> | Promise<SignalRConnection>'. Type 'Promise<ISignalRConnection>' is not assignable to type 'Promise<SignalRConnection>'. Type 'ISignalRConnection' is not assignable to type 'SignalRConnection'. Property '_status' is missing in type 'ISignalRConnection'.
with version 2.0.4 get the same error
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top GitHub Comments
you just have to change the
import { SignalR, SignalRConnection } from 'ng2-signalr';
toimport { SignalR, ISignalRConnection } from 'ng2-signalr';
and change the
export class ConnectionResolver implements Resolve<SignalRConnection>
toexport class ConnectionResolver implements Resolve<ISignalRConnection>
it is just that the example is not updated.
@ahlunju 's fix worked for me with the latest version.