importing anything from `@angular/router` breaks EventEmitter
System
OS: Mac OSX El Capitan Node: 6.3.0 Angular CLI: 1.0.0-beta.9 angular-router: 3.0.0-beta.2
Repro
This is a problem in an app created with the CLI.
My build compiles fine without any imports from angular-router, but if I add import {} from '@angular/router' in my code, I get the following error:
'Type EventEmitter<{}> is not assignable to type 'EventEmitter<string>'
In the constructor function I declare new EventEmitter variables like so: x: EventEmitter<string>. I instantiate the event emitter like so: x = new EventEmitter();.
This usually works fine, but when I import from angular/router it goes haywire.
Here's the code in my constructor function that causes the hangup:
x = EventEmitter<string>;
...
constructor() {
this.x = new EventEmitter();
}
My package.json is attached
Try
this.x = new EventEmitter<string>();
p.s. I'm pretty sure this is not really an issue with angular-cli and the question should be on stack overflow or somewhere like that.
OK got it. Thanks!
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.