Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 财产';uiSignal';不存在于类型';可观察<;任何>;_Angular - Fatal编程技术网

Angular 财产';uiSignal';不存在于类型';可观察<;任何>;

Angular 财产';uiSignal';不存在于类型';可观察<;任何>;,angular,Angular,我已将我的应用程序从angular 4升级到angular 6 我得到了一些错误,比如说类型的Observable上不存在属性uiSignal。类型可以是数字、字符串或任何用户定义的对象。如果您注意到Obserable.dts,那么它已经声明了类型为any的uiSignal。我想typescript正在抱怨,因为它无法确定类型。我如何解决这个问题 private _manageShare(sharingOptions: ISharingOptions) { const runId = s

我已将我的应用程序从angular 4升级到angular 6

我得到了一些错误,比如说类型的Observable上不存在属性uiSignal。类型可以是数字、字符串或任何用户定义的对象。如果您注意到Obserable.dts,那么它已经声明了类型为any的uiSignal。我想typescript正在抱怨,因为它无法确定类型。我如何解决这个问题

private _manageShare(sharingOptions: ISharingOptions) {
    const runId = sharingOptions.runId;
    this._runsProxy.manageShares(this._translate.instant('CURRENT_MODEL.TITLE'), runId, sharingOptions.changes)
      .uiSignal({ debugInfo: 'saving share', uiLabel: this._translate.instant('GLOBAL.BUSY.PERSISTING') })
      .subscribe(ret => {
        const runModel = this.runs.find(o => o.runId === runId);
        runModel.info.sharedWith = ret.data;
        const runName = runModel.info.name;

        this.calculatePages();
        this._sendAnalytics(runId, 'RunShareUpdated');
        this._alertService.success(this._translate.instant('RUN.SHARE.TOAST_MANAGE', { runName }));
      });
  }
可观测的

import { Operator } from './Operator';
import { Subscriber } from './Subscriber';
import { Subscription } from './Subscription';
import { TeardownLogic, OperatorFunction, PartialObserver, Subscribable } from './types';
import { iif } from './observable/iif';
import { throwError } from './observable/throwError';
/**
 * A representation of any set of values over any amount of time. This is the most basic building block
 * of RxJS.
 *
 * @class Observable<T>
 */

export declare class Observable<T> implements Subscribable<T> {
    /** Internal implementation detail, do not use directly. */
    _isScalar: boolean;
    static uiSignal: () => any;
    /** @deprecated This is an internal implementation detail, do not use. */
    source: Observable<any>;
    /** @deprecated This is an internal implementation detail, do not use. */
    operator: Operator<any, T>;
    /**
     * @constructor
     * @param {Function} subscribe the function that is called when the Observable is
     * initially subscribed to. This function is given a Subscriber, to which new values
     * can be `next`ed, or an `error` method can be called to raise an error, or
     * `complete` can be called to notify of a successful completion.
     */
    constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic);
    /**
     * Creates a new cold Observable by calling the Observable constructor
     * @static true
     * @owner Observable
     * @method create
     * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
     * @return {Observable} a new cold observable
     * @nocollapse
     */
    static create: Function;
    /**
     * Creates a new Observable, with this Observable as the source, and the passed
     * operator defined as the new observable's operator.
     * @method lift
     * @param {Operator} operator the operator defining the operation to take on the observable
     * @return {Observable} a new observable with the Operator applied
     */
    lift<R>(operator: Operator<T, R>): Observable<R>;
    subscribe(observer?: PartialObserver<T>): Subscription;
    subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Subscription;
    /** @deprecated This is an internal implementation detail, do not use. */
    _trySubscribe(sink: Subscriber<T>): TeardownLogic;
    /**
     * @method forEach
     * @param {Function} next a handler for each value emitted by the observable
     * @param {PromiseConstructor} [promiseCtor] a constructor function used to instantiate the Promise
     * @return {Promise} a promise that either resolves on observable completion or
     *  rejects with the handled error
     */
    forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void>;
    /** @internal This is an internal implementation detail, do not use. */
    _subscribe(subscriber: Subscriber<any>): TeardownLogic;
    /**
     * @nocollapse
     * @deprecated In favor of iif creation function: import { iif } from 'rxjs';
     */
    static if: typeof iif;
    /**
     * @nocollapse
     * @deprecated In favor of throwError creation function: import { throwError } from 'rxjs';
     */
    static throw: typeof throwError;
    pipe(): Observable<T>;
    pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;
    pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;
    pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;
    pipe<A, B, C, D>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>): Observable<D>;
    pipe<A, B, C, D, E>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>): Observable<E>;
    pipe<A, B, C, D, E, F>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>): Observable<F>;
    pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>;
    pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>;
    pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>;
    pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>, ...operations: OperatorFunction<any, any>[]): Observable<{}>;
    toPromise<T>(this: Observable<T>): Promise<T>;
    toPromise<T>(this: Observable<T>, PromiseCtor: typeof Promise): Promise<T>;
    toPromise<T>(this: Observable<T>, PromiseCtor: PromiseConstructorLike): Promise<T>;
}
从“/Operator”导入{Operator};
从“./Subscriber”导入{Subscriber};
从“/Subscription”导入{Subscription};
从“/types”导入{TeardownLogic,OperatorFunction,PartialObserver,Subscribable};
从“./observable/iif”导入{iif};
从“./observable/throwError”导入{throwError};
/**
*任何时间内任何一组值的表示。这是最基本的构造块
*RxJS的。
*
*@级可观测
*/
导出声明类Observable实现Subscribable{
/**内部实现细节,不要直接使用*/
_isScalar:布尔型;
静态UI信号:()=>任何;
/**@deprecated这是一个内部实现详细信息,请勿使用*/
资料来源:可见;
/**@deprecated这是一个内部实现详细信息,请勿使用*/
操作员:操作员;
/**
*@constructor
*@param{Function}订阅当可观察对象为
*初始订阅。此函数被赋予一个订阅方,其中包含新值
*可以是“next”,或者可以调用“error”方法来引发错误,或者
*可以调用'complete'来通知成功完成。
*/
构造函数(subscribe?:(this:Observable,subscriber:subscriber)=>TeardownLogic);
/**
*通过调用Observable构造函数创建一个新的cold Observable
*@static-true
*@可观察到的所有者
*@methodcreate
*@param{Function}subscribe?要传递给可观察构造函数的订阅函数
*@return{Observable}一个新的冷可观测
*@nocollapse
*/
静态创建:函数;
/**
*创建一个新的可观察对象,将此可观察对象作为源,并传递
*运算符定义为新的可观察对象的运算符。
*@方法提升
*@param{Operator}Operator定义对可观察对象执行的操作的操作符
*@return{Observable}应用运算符的新Observable
*/
升降机(操作员:操作员):可观察;
订阅(观察员?:PartialObserver):订阅;
订阅(下一个?:(值:T)=>void,error?:(error:any)=>void,complete?:()=>void):订阅;
/**@deprecated这是一个内部实现详细信息,请勿使用*/
_trySubscribe(sink:Subscriber):拆卸逻辑;
/**
*@methodforeach
*@param{Function}下一步是可观察对象发出的每个值的处理程序
*@param{PromiseConstructor}[PromiseConstructor]用于实例化承诺的构造函数
*@return{Promise}在可观察到的完成时解决的承诺,或
*拒绝已处理的错误
*/
forEach(next:(值:T)=>void,promiseCtor?:PromiseConstructorLike):承诺;
/**@internal这是内部实现细节,请勿使用*/
_订阅(订阅方:订阅方):删除下载逻辑;
/**
*@nocollapse
*@不推荐使用iif创建函数:从“rxjs”导入{iif};
*/
静态if:iif的类型;
/**
*@nocollapse
*@deprecated支持throwError创建函数:从'rxjs'导入{throwError};
*/
静态投掷:投掷者的类型;
管道():可见;
管道(op1:OperatorFunction):可观察;
管道(op1:OperatorFunction,op2:OperatorFunction):可观察;
管道(op1:OperatorFunction,op2:OperatorFunction,op3:OperatorFunction):可观察;
管道(op1:OperatorFunction,op2:OperatorFunction,op3:OperatorFunction,op4:OperatorFunction):可观察;
管道(op1:OperatorFunction,op2:OperatorFunction,op3:OperatorFunction,op4:OperatorFunction,op5:OperatorFunction):可观察;
管道(op1:OperatorFunction,op2:OperatorFunction,op3:OperatorFunction,op4:OperatorFunction,op5:OperatorFunction,op6:OperatorFunction):可观察;
管道(op1:OperatorFunction,op2:OperatorFunction,op3:OperatorFunction,op4:OperatorFunction,op5:OperatorFunction,op6:OperatorFunction,op7:OperatorFunction):可观察;
管道(op1:OperatorFunction,op2:OperatorFunction,op3:OperatorFunction,op4:OperatorFunction,op5:OperatorFunction,op6:OperatorFunction,op7:OperatorFunction,op8:OperatorFunction):可观察;
管道(op1:OperatorFunction,op2:OperatorFunction,op3:OperatorFunction,op4:OperatorFunction,op5:OperatorFunction,op6:OperatorFunction,op7:OperatorFunction,op8:OperatorFunction,op9:OperatorFunction):可观察;
管道(op1:OperatorFunction,op2:OperatorFunction,op3:OperatorFunction,op4:OperatorFunction,op5:OperatorFunction,op6:OperatorFunction,op7:OperatorFunction,op8:OperatorFunction,op9:OperatorFunction,…操作:OperatorFunction[]):可观察;
托普罗米斯(这个:可观察的):承诺;
托普罗米斯(这个:可观察的,允诺者:允诺的类型):允诺;
承诺(这个:可观察的,允诺者:类似允诺者的):承诺;
}
rx.extensions.ts

import { Observable, Subscription } from 'rxjs';

export interface UiSignalData { uiLabel: string; debugInfo: string; }
export interface UiSignalSignature<T> {
    (label: string | UiSignalData): Observable<T>;
}
export interface FireAndForgetSignature {
    (): Subscription;
}
declare module 'rxjs/Observable' {
    interface Observable<T> {
        uiSignal: UiSignalSignature<T>;
        fireAndForget: FireAndForgetSignature;
    }
}
import{Observable,Subscription}来自'rxjs';
导出接口UiSignalData{uiLabel:string;debugInfo:string;}
导出接口UISignature{
(标签:字符串| UiSignalData):可观察;
}
导出接口FireAndForgetSignature{
():认购;
}
声明模块“rxjs/Observable”{
可观测界面{
uiSignal:UiSignalSignature;
fireAndForget:fireAndForget签名;
}
}

我不知道你想用这个
uiSignal
c实现什么