Angular 集成导致未处理的承诺拒绝

Angular 集成导致未处理的承诺拒绝,angular,intro.js,Angular,Intro.js,我想在我的应用程序中集成intro.js 我得到了intro.js框架(2.4.0)和@types(2.0.28)。 我的代码生成,但不执行 import { Component, OnInit } from '@angular/core'; @Component({ selector: 'my', template: require('./my.component.html') }) export class My implements OnInit { ngOnI

我想在我的应用程序中集成intro.js

我得到了intro.js框架(2.4.0)和@types(2.0.28)。 我的代码生成,但不执行

import { Component, OnInit } from '@angular/core';

@Component({
    selector: 'my',
    template: require('./my.component.html')
})
export class My implements OnInit {

    ngOnInit() {
        introJs('introduction').start();
    }
}
introJS方法在TypeScript中可以识别。

我有一个错误:

Unhandled Promise rejection: introJs is not defined ; Zone: angular ; Task: Promise.then ; Value: ReferenceError: introJs is not defined(…) ReferenceError: introJs is not defined

你有什么想法吗?

你不能直接将JS与angular2一起使用。您可以按照或选择正确的解决方案。祝您好运。

您需要安装并参考
IntroJS的打字功能
您正在导入库?是的,我安装@type/intro.js并导入库intro.js。我的环境可以识别JS方法