解析文件时的angularjs2和ionic2

angularjs2 and ionic2 while parsing file

解析时file 这是行 public http:Http;

虽然您的问题有点短,但我认为您的问题是您尝试在方法参数中使用类型,而您使用的是 ES6 而不是 TypeScript。

方法参数仅在 TypeScript 中受支持。

有两种方法可以解决您的问题:

  • 在 ES6 中,使用静态 parameters getter 配置依赖注入的预期类型:

    constructor(http) {
      this.http = http;
    }
    
    get parameters() {
      return [[Http]];
    }
    
  • 您使用 --ts 选项和 ionic start 创建 Ionic2 项目。