mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #4789 from mickdelaney/master
Typings For AngularJS Extensions For RxJS
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// Type definitions for angularjs extensions to rxjs
|
||||
// Project: http://reactivex.io/
|
||||
// Definitions by: Mick Delaney <https://github.com/mickdelaney/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="rx.angular.d.ts" />
|
||||
|
||||
var app = angular.module('testModule');
|
||||
|
||||
interface AppScope extends rx.angular.IRxScope {
|
||||
}
|
||||
|
||||
app.controller('Ctrl', ($scope: AppScope) => {
|
||||
|
||||
this.inputObservable = $scope.$toObservable('term')
|
||||
.throttle(400)
|
||||
.safeApply($scope, (results: any) => {
|
||||
this.results = results;
|
||||
});
|
||||
|
||||
});
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for angularjs extensions to rxjs
|
||||
// Project: http://reactivex.io/
|
||||
// Definitions by: Mick Delaney <https://github.com/mickdelaney/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
/// <reference path="../rx/rx.d.ts" />
|
||||
/// <reference path="../rx/rx.time.d.ts" />
|
||||
|
||||
declare module Rx {
|
||||
|
||||
interface IObservable<T> {
|
||||
safeApply($scope: ng.IScope, callback: (data: any) => void): Rx.Observable<any>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module rx.angular {
|
||||
|
||||
export interface IRxScope extends ng.IScope {
|
||||
$toObservable(property: string): Rx.Observable<any>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user