我想在這裏運行第一個例子。 Rx.Observable.fromEvent(element, eventName, [selector])運行RxJS官方`fromEvent`時輸入錯誤教程
但編譯時,編譯器會引發以下錯誤。
Uncaught exception: { [TypeScript error: index.ts(44,38): Error TS2345: Argument of type 'JQuery' is not assignable to parameter of type 'Node'. Property 'attributes' is missing in type 'JQuery'.]
message: 'index.ts(44,38): Error TS2345: Argument of type \'JQuery\' is not assignable to parameter of type \'Node\'.\n Property \'attributes\' is missing in type \'JQuery\'.'
在
var source = Rx.Observable.fromEvent(input, 'click');
輸入是
var input = $('#input');
以下是我的進口:
/// <reference path="./typings/rx/rx.d.ts" />
/// <reference path="./typings/rx/rx.async.d.ts" />
/// <reference path="./typings/jquery/jquery.d.ts" />
import Rx = require('rx');
import $ = require('jquery');
那麼你的'輸入'在哪裏? –