我是角度尝试学习Angular概念的新蜜蜂,我要做的是Observable作为返回类型和返回主题,其中IEvent是一个定义如下的接口,

export interface IEvent{
    id: number
    name:string 
    date: Date
    time: string
    price: number
    imageUrl:string
    location?:{
        address:string
        city:string
        country:string
    }
    onlineurl?:string
    sessions:ISession[]

}

在另一个类我有这样的代码,

const EVENTS : IEvent[] = [
        {
          id: 1,
          name: 'Angular Connect',
          date: new Date('9/26/2036'),
          time: '10:00 am',
          price: 599.99,
          imageUrl: '/app/assets/images/angularconnect-shield.png',
          location: {
            address: '1057 DT',
            city: 'London',
            country: 'England'
          },
          ......
     }

并且在同一个类中有一个方法作为getEvents(),如下所示,

@Injectable()
export class EventService{
    getEvents(): Observable<IEvent[]>{
      let subject = new Subject<IEvent[]>()
      setTimeout(() => { subject.next(EVENTS); subject.complete();},100)

      return subject
    }

在“return subject”语句中,获取编译器错误,类型Observable不能分配给Observable类型,Type IEvent []不能分配给类型'R' .

我不明白为什么这个编译时错误,因为我知道Subject扩展了Observable所以返回主题对我有意义 . 返回一个主题并返回类型为Observable我做错了什么 .