与Ionic2/Angular2应用程序一起使用Angular1服务:没有服务提供商

与Ionic2/Angular2应用程序一起使用Angular1服务:没有服务提供商,angular,dependency-injection,ionic2,bootstrapping,Angular,Dependency Injection,Ionic2,Bootstrapping,我正在尝试创建新的Ionic2应用程序,它使用我的一些Ionic1 Angular服务。我已经阅读并知道我应该使用UpgradeAdapter,但由于某些原因它不起作用 这是我的app.ts文件,用于引导Ionic2应用程序: // This is to tell TS that `require` method is in fact available declare function require(name:string); import { Component, Inject } fr

我正在尝试创建新的Ionic2应用程序,它使用我的一些Ionic1 Angular服务。我已经阅读并知道我应该使用UpgradeAdapter,但由于某些原因它不起作用

这是我的
app.ts
文件,用于引导Ionic2应用程序:

// This is to tell TS that `require` method is in fact available
declare function require(name:string);

import { Component, Inject } from '@angular/core';
import { ionicBootstrap } from 'ionic-angular';
import { HTTP_PROVIDERS } from '@angular/http';

let angular = require('angular');

import { UpgradeAdapter } from '@angular/upgrade';
let adapter = new UpgradeAdapter();

angular.module('myAngular1App', [])
     .service('MyAngular1Service', function() {
        return {
            hello: function() {
                console.log('Hello!')
            }
        }
    });

adapter.bootstrap(document.body, ['myAngular1App']);

adapter.upgradeNg1Provider('testService');

@Component({
    templateUrl: 'build/app.html'
})
class MyAngular2App {
    constructor(@Inject('testService') testService) {
        console.log('construct');
        testService.hello();
    }
}

ionicBootstrap(MyAngular2App, [
    HTTP_PROVIDERS
]);
没有Angular1
testService
注入,它工作得很好,但是有了它,我看到DI异常
没有testService的提供者

我错过了什么