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

Commit c5fc4d5

Browse files
author
Antonio Marcos SS Jr
committed
- updated example in folder.
- updated service, so that's possible to make chainable methods. - removed promises... it's better to call the callback instead it's a straight forward solution :P - removed deferList (not needed anymore) - updated directive so it's not listening to an trigger anymore. updated version and build Update README.md added directive so it's possible to disable or enable a button when it's required. fixed a problem where wasn't possible to click some buttons using the directive. - updated the example. - added a feature so we can't click on buttons if we set the directive. - added wiki url; Update README.md - fixed some typos. - updated from introDisableButton to ngIntroDisableButton
1 parent 47845b2 commit c5fc4d5

File tree

7 files changed

+243
-190
lines changed

7 files changed

+243
-190
lines changed

README.md

+26-36
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This project will return the whole angular module so if you want to use as a dep
2929

3030
## How to use
3131

32-
You can use the two main directives, which are `ng-intro-options` and `ng-intro-method`, or you can include the service called `ngIntroService`
32+
It's possible to include on your controller the service `ngIntroService` and customize as you need, or you may configure on your view the directives which are `ng-intro-options`, `ng-intro-method` and `ng-intro-disable-button`.
3333

3434
### Setting Options
3535

@@ -49,9 +49,10 @@ The directive will create a method on `$scope.CallMe` so that you can invoke it
4949

5050
### Call the start method
5151

52-
You can invoke it from an event such a click,
53-
54-
`ng-click="CallMe();"`
52+
You can invoke it from an event such as click.
53+
`
54+
ng-click="CallMe();"
55+
`
5556

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

@@ -74,70 +75,59 @@ Intro.js provides several callbacks. You can receive these callbacks in your co
7475
`ng-intro-onchange="ChangeEvent"`
7576

7677
In your controller, create `ChangeEvent`
77-
78+
```javascript
7879
$scope.ChangeEvent = function (targetElement, scope) {
7980
console.log("Change Event called");
8081
console.log(targetElement); //The target element
8182
console.log(this); //The IntroJS object
8283
};
84+
```
8385

84-
The other intro.js callbacks you can specify are `ng-intro-oncomplete`, `ng-intro-onexit`, `ng-intro-onchange` `ng-intro-onbeforechange` and `ng-intro-onafterchange`.
86+
The other intro.js callbacks you can specify are `ng-intro-oncomplete`, `ng-intro-onexit`, `ng-intro-onchange`, `ng-intro-onbeforechange`, `ng-intro-onafterchange`, `ng-intro-onhintsadded`, `ng-intro-onhintclick` and `ng-intro-onhintclose`.
8587

8688
### As a service
8789

88-
There are two ways of make use of callbacks:
89-
90-
**Using promises**
91-
92-
The methods that return promises:
90+
In your controller:
91+
```javascript
92+
ngIntroService.onComplete(function(){
93+
console.log('on complete callback!')
94+
});
95+
```
96+
the list of supported callbacks are:
9397

9498
* `onComplete`
9599
* `onExit`
96100
* `onBeforeChange`
97-
* `onAfterChange`
98101
* `onChange`
99-
100-
**Using watches (not recommended, available for compatibility)**
101-
102-
`scope.$on('ngIntro-onAfterChange', function () {
103-
ngIntro.exit();
104-
´
105-
Its triggers are:
106-
107-
* `ngIntro-onComplete`
108-
* `ngIntro-onBeforeChange`
109-
* `ngIntro-onChange`
110-
* `ngIntro-onAfterChange`
111-
* `ngIntro-onExit`
112-
113-
* `ngIntro-onHintclick`
114-
* `ngIntro-onHintclose`
115-
* `ngIntro-onHintsAdded`
116-
117-
118-
102+
* `onAfterChange`
103+
* `onHintClick`
104+
* `onHintClose`
105+
* `onHintsAdded`
119106

120107
### Exit Method
121108

122109
**Directive** - `ng-intro-exit-method="ExitMe"`
110+
123111
**Callback** - `$scope.ExitMe(function() { //callback } );`
124112

125113
You can also call `$scope.ExitMe()` from your controller.
126114

127115

128116
**Service** - `ngIntroService.exit()`
129-
**Callback** - `ngIntroService.onExit().then(function(){
130-
console.log('do something.')
117+
118+
**Callback** - `ngIntroService.onExit(function(){
119+
console.log('do something.');
131120
});`
132121

133122

134123
### Plunker
135124

136-
You may use as Directive [as shown here](http://plnkr.co/edit/wo9EzfbOFjM7NDoAvmjA?p=preview)
125+
You may use as Directive standalone without injecting ngIntroService [as shown here](http://plnkr.co/edit/wo9EzfbOFjM7NDoAvmjA?p=preview)
137126

138127
or
139128

140-
alternatively as Service [as shown here](http://plnkr.co/edit/4JdONL)
129+
alternatively as Service, [as shown here](http://plnkr.co/edit/4JdONL)
130+
*i've added the directive, but it's not required, it's there to show the compatibility between both*
141131

142132
## How to build
143133

build/angular-intro.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)