我刚刚将角度6.1升级到7,在我的Auth拦截器上遇到了以下错误:
ERROR in src/app/core/interceptors/auth.interceptor.ts(31,9): error TS2322: Type 'Observable<{} | HttpProgressEvent | HttpSentEvent | HttpHeaderResponse | HttpResponse<any> | HttpUserEvent<any>>' is not assignable to type 'Observable<
我有这样一个java接口
public interface MyInterface<T> {
public <V extends T> V get(String key, Bundle bundle);
}
请注意该方法的<V extends T>类型参数。
然后我有一个类MyFoo implements MyInterface
class MyFoo implements MyInterface<Object> { // Object because can be any type
@Override public <V>
代码片段 fun main() {
val myClass : AbsClass<Any> = MyClass()
// Error - type mismatch
val myClass : AbsClass<*> = MyClass()
// Not Error, but parameter of 'foo' is 'Nothing'
val myClass : AbsClass<Any> = MyClass() as AbsClass<Any>
//
我正在将我的代码转换为使用RxJS6语法来使用管道和映射,但是我得到了错误。
error TS2345: Argument of type '(error: any) => void' is not assignable to parameter of type '(err:
any, caught: Observable<void>) => ObservableInput<{}>'.
Type 'void' is not assignable to type 'ObservableInput<
如何从RxJS 5迁移到RxJS 6 fromPromise,同时保持类型不变? RxJS 5,一切正常: return Observable.fromPromise<SomeInterface>(somePromiseFn()) RxJS 6: return from<SomeInterface>(somePromiseFn()) 投诉: Type 'SomeInterface' does not satisfy the constraint 'ObservableInput<any>'.
Type 'Some
我试图在我的应用程序中有一个无限滚动部分。为了实现这一点,我使用来处理滚动事件等等。当滚动到div底部时,我调用一个函数来获取更多数据。到目前一切尚好。
为了提高此函数的效率,我尝试在调用之前等待几秒钟,并确保数据被正确处理。要做到这一点,我一直在查看上显示的示例。
我有一个与本文中显示的类似的设置,我的问题是,当我调用switchMap()时,我得到了以下错误
Type 'void' is not assignable to type 'ObservableInput<{}>'
这是我的代码示例:
private scrollEndActive:
错误,这是升级到10角后的错误,有什么需要更改的吗?我能改变什么来解决这个问题。
Error: src/app/shared/layout/menu-list-item/menu-list-item.component.ts:22:58 - error TS2729: Property 'expanded' is used before its initialization.
22 @HostBinding('attr.aria-expanded') ariaExpanded = this.expanded;