2016-12-12 10 views
2

私のアプリケーションに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で認識されます。 enter image description here

私はこのエラーがあります:

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

あなたが任意のアイデアを持っていますか?

+2

「IntroJS」の入力を参照する必要があります –

+0

ライブラリをインポートしていますか? – Bazinga

+0

はい、@ type/intro.jsをインストールし、ライブラリintro.jsをインポートします。私の環境はintroJSメソッドを認識します – di99er

答えて

1

JSを直接angular2で直接使用することはできません。適切なソリューションについては、this tutorialまたはthis packageに従うことができます。運が良かった。

+0

ありがとう、私のコードはよくタイプしています – di99er

関連する問題