Skip to content
This repository was archived by the owner on Jan 17, 2022. It is now read-only.

Fixed issue #71 #77

Merged
merged 3 commits into from
Apr 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ You can install this package through `Bower` by using the following command :

bower install angular-intro.js --save

## NPM

You can install this package through `NPM` by using the following command :

npm install angular-intro.js --save

## Webpack

You can use this package in your webpack project, first by including `intro.js` and its css file. Next you need to require this package.

import ngIntro from 'angular-intro.js';

This project will return you the hole angular module so if you want to use as a dependency in your own angular module you would need to reference the name `ngIntro.name`.

## How to use

Expand All @@ -22,35 +35,35 @@ The two main directives are `ng-intro-options` and `ng-intro-method`.

`ng-intro-options="IntroOptions"`

You should create a `$scope.IntroOptions` in your controller which contains the intro.js options. The options are exactly the same as [the original](https://github.com/usablica/intro.js#options). This also allows you to modify the options as part of your controller behavior if necessary. You don't have to use `IntroOptions`, you can specify some other name.
You should create a `$scope.IntroOptions` in your controller which contains the intro.js options. The options are exactly the same as [the original](https://github.com/usablica/intro.js#options). This also allows you to modify the options as part of your controller behavior if necessary. You don't have to use `IntroOptions`, you can specify some other name.

### Start method

`ng-intro-method="CallMe"`
`ng-intro-method="CallMe"`

The directive will create a method on `$scope.CallMe` so that you can invoke it yourself later. Make sure the there isn't a method `CallMe` already in your controller. To use the method be sure to wrap it with `$timeout`. You don't have to use `CallMe`, you can specify some other name.

### Call the start method

You can invoke it from an event such a click,
You can invoke it from an event such a click,

`ng-click="CallMe();"`
`ng-click="CallMe();"`

as long as you are still in the same controller scope. You can also specify a step number in the method call, `CallMe(3);`.

You can start the intro from code, either call `$scope.CallMe();`. If the `$scope.CallMe();` doesn't work, it might be because your DOM isn't ready. Put it in a `$timeout`.

### Autostart

If you set `ng-intro-autostart="true"`, the intro will start as soon as the directive is ready.
If you set `ng-intro-autostart="true"`, the intro will start as soon as the directive is ready.

### Autorefresh

If an intro tour includes dynamic content, use `ng-intro-autorefresh="true"` to call Intro.js' refresh method.

### Callbacks

Intro.js provides several callbacks. You can receive these callbacks in your controller. For example, for the `onchange` event, specify the function name in the directive.
Intro.js provides several callbacks. You can receive these callbacks in your controller. For example, for the `onchange` event, specify the function name in the directive.

`ng-intro-onchange="ChangeEvent"`

Expand Down Expand Up @@ -81,19 +94,19 @@ You can also use this [sample plunker](http://plnkr.co/edit/wo9EzfbOFjM7NDoAvmjA
If you want to build or contribute, first, get the node modules needed (grunt, bower)

npm install

Next, use bower to get the JS libraries needed

node_modules/.bin/bower install

Then, whenever you make any changes, get grunt to build the minified angular-intro.min.js

node_modules/.bin/grunt
node_modules/.bin/grunt

Finally, view the demo page to make sure everything's working; start a web server:

./node_modules/.bin/grunt connect:server

And browse to `http://localhost:8000/example/index.html`


Expand All @@ -102,9 +115,3 @@ And browse to `http://localhost:8000/example/index.html`
## License

As with intro.js, this is under the [MIT license](https://github.com/mendhak/angular-intro.js/blob/master/LICENSE).






4 changes: 2 additions & 2 deletions build/angular-intro.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"description": "Angular directive to wrap intro.js",
"main": "src/angular-intro.js",
"directories": {
"example": "example",
"lib": "lib"
"example": "example"
},
"scripts": {
"test": "grunt test"
Expand Down Expand Up @@ -34,5 +33,15 @@
"grunt-contrib-uglify": "~0.9.2",
"grunt-contrib-watch": "~0.6.1",
"load-grunt-tasks": "~3.2.0"
},
"dependencies": {
"bower": "^1.5.4",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-connect": "^0.11.2",
"grunt-contrib-jshint": "^0.11.3",
"grunt-contrib-uglify": "^0.9.2",
"grunt-contrib-watch": "^0.6.1",
"load-grunt-tasks": "^3.2.0"
}
}
6 changes: 2 additions & 4 deletions src/angular-intro.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(["angular", "intro"], factory);
define(["angular", "intro.js"], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('angular'), require('intro'));
module.exports = factory(require('angular'), require('intro.js'));
} else {
root.angularIntroJs = factory(root.angular, root.introJs);
}
Expand Down Expand Up @@ -145,5 +145,3 @@
return ngIntroDirective;

}));