2

I want to integrate intro.js in my app.

I get intro.js framework (2.4.0) and @types (2.0.28). My code build, but don't execute.

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

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

    ngOnInit() {
        introJs('introduction').start();
    }
}

introJS method's are recognize in TypeScript. enter image description here

I have this error :

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

Do you have any idea ?

di99er
  • 73
  • 7

1 Answers1

1

You cannot directly use JS directly with angular2 . You can follow this tutorial or this package for the right solution . Best of luck.

Subtain Ishfaq
  • 793
  • 9
  • 16