You have a couple of problems with your code.
1). Observable.fromEventexpects the HTML element to become the first parameter, however you are passing a jQuery instance.
2). You are trying to subscribe to a constructor that does not guarantee that the contents of the component will be loaded by this time.
3). You are using a hardcoded CSS selector #search, which you should never do.
Now you can fix it:
@Component({
selector: 'my-app',
template: `
<div>
<input #search type="text" class="form-control">
</div>
`
})
export class AppComponent {
@ViewChild('search') input: ElementRef
ngAfterContentInit() {
var keyups = Observable.fromEvent(this.input.nativeElement, "keyup");
keyups.subscribe(data => console.log(data));
}
}
: http://plnkr.co/edit/5TFDv0OoV8wWnDYneiFD?p=preview