Skip to content

Instantly share code, notes, and snippets.

@yutsengwei
Last active June 14, 2019 10:27
Show Gist options
  • Select an option

  • Save yutsengwei/127d0bbc8dffd13640a76f50ba4e879f to your computer and use it in GitHub Desktop.

Select an option

Save yutsengwei/127d0bbc8dffd13640a76f50ba4e879f to your computer and use it in GitHub Desktop.
Using pure intro.js in Angular 5 [Note]
# 1 . npm install intro.js --save
# 2. @import '~intro.js/minified/introjs.min.css'; to styles.scss
# 3. add to the componenet which you want to show
//add declaration to the top
const IntroJs = require('/pathTo/node_modules/intro.js');
// add a click function to the component
startTour() {
console.log('Starting tour');
const intro = IntroJs.introJs();
// Start tutorial
intro.start();
}
# 4. implement tag to html
<h1 data-intro='Hello step one!' (click)="startTour()" >This is the first one step!</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment