Last active
June 14, 2019 10:27
-
-
Save yutsengwei/127d0bbc8dffd13640a76f50ba4e879f to your computer and use it in GitHub Desktop.
Using pure intro.js in Angular 5 [Note]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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