运行角度应用程序错误TS2305时出错?

时间:2018-11-30 15:20:40

标签: javascript angular typescript

嗨,我正在使用ng serve命令运行角度应用程序。我可以看到如下错误。

 ERROR in src/app/accounts/account-form/account-form.component.ts(29,3): error TS2305: Module '"/home/prasanth/primecastworkspace3/primecast-web/src/app/shared/services/index"' has no exported member 'ModeService'.

我的account-form.component.ts如下 account-form.component.ts

    import {
      AuthenticationService,
      FeaturesService,
      AddressProfilesService,
      FlightsService,
      MarketPropositionService
    } from '../../shared/services';
    @Component({
      selector: 'pc-account-form',
      templateUrl: './account-form.component.html',
      styleUrls: ['./account-form.component.scss']
    })
    export class AccountFormComponent implements OnInit {

    }

index.ts file is as follows
export * from './accounts.service';
export * from './address-profiles.service';
export * from './authentication.service';
export * from './campaigns.service';
export * from './config.service';
export * from './confirm.service';
export * from './contact-lists.service';
export * from './countries.service';
export * from './features.service';
export * from './files.service';
export * from './flights.service';
export * from './forgot-password.service';
export * from './locations.service';
export * from './not-found.service';
export * from './languages.service';
export * from './locations.service';
export * from './notifications.service';
export * from './profile-parameters.service';
export * from './profiles.service';
export * from './recipient-gatherings.service';
export * from './settings.service';
export * from './templates.service';
export * from './toast.service';
export * from './users.service';
export * from './market-proposition.service';

market-proposition.service.ts

import { HttpClient } from '@angular/common/http';
import { Injectable, OnInit } from '@angular/core';
import { AppConfig } from '../models';
import { MarketProposition } from '../models';
import { ConfigService } from './config.service';
import { Observable } from 'rxjs/Observable';
import { shareReplay } from 'rxjs/operators';

@Injectable()
export class MarketPropositionService {
  config: AppConfig = this.configService.config;

  constructor(
    private httpClient: HttpClient,
    private configService: ConfigService
  ) {}

  get() {
    return this.httpClient
      .get<MarketProposition>(`${this.config.api}/find-market-proposition`)
      .pipe(shareReplay(1));
  }
}

我要做的就是将市场提议服务对象注入我的account-form.component.ts中。

我之前在不同的文件中声明了ModeService类,但是在重构之后却抛出了错误。 请帮助

1 个答案:

答案 0 :(得分:0)

实际上是我的错。我在vss代码中更改了角度代码,但是没有保存在vss代码中。当我比较使用cat命令和gui的文件系统时,我意识到了问题