import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { DropDownService } from './service/drop-down.service';
@Injectable()
export class AppResolve implements Resolve<any[]> {
constructor(private dropDownService: DropDownService) { }
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any> {
return this.dropDownService.getDropDown();
}
}
返回方法给出错误:
类型'any []'不能分配给'Observable'类型。属性 类型'any []'中缺少'_isScalar'。
我的代码出了什么问题?