#Angular Tutorial#
An angular bower component for creating simple tutorials.
##Installation##
###Build###
bower install angular-tutorial
cd bower_components/angular-tutorial
npm install && bower install && grunt
###Include Dependencies###
Angular Tutorial depends on UI Bootstrap's Modal and Bootstrap's tooltip (we're forced to use Bootstrap's native tooltip until UI Bootstrap's tooltip supports programmatic triggers).
Make sure they are included in the page along with the angular-tutorial source:
<script type="text/javascript" src="bower_components/bootstrap/js/tooltip.js"></script>
<script type="text/javascript" src="bower_components/angular-ui-bootstrap/dist/ui-bootstrap-custom-tpls-0.10.0.js"></script>
<script type="text/javascript" src="bower_components/angular-tutorial/angular-tutorial.js"></script>
##Usage##
Add angular-tutorial as a module dependency:
angular.module('app','ngTutorial');
Register a tutorial:
angular.module('app').controller
(
'AppCtrl',
[
'$scope','$tutorial',
function($scope,$tutorial)
{
$tutorial.register
(
"tutorial1", //id
{}, //config
[ //steps
{
type: "showMessage",
message: {
content:"Step 1",
buttonText: "Start",
header: "Welcome!"
}
},
.
.
.
]
);
}
]
);
Trigger a tutorial:
<button type='button' class='btn btn-lin' ng-tutorial ng-tutorial-id='mytutorial'>My Tutorial</button></pre>
##Step Types##
####waitForClick####
The waitForClick step type tells the tutorial to wait for one of the specified targets to be clicked.
Properties
highlightOne or more css selectors to hightlight via a cutout in the backdrop (defaults totargetsif unspecified) (Array)targetsOne or more css selectors representing click targets (Array)tooltipsTooltips to show (Array) Tooltip PropertiesselectorCSS selector to affix the tooltip to (String, required)textText to display in the tooltip (String)placementOne of top, right, bottom or left (String)
####waitForNavigate#####
The waitForNavigate step type tells the tutorial to wait for a change to $location.path().
Properties
highlightOne or more css selectors to hightlight via a cutout in the backdrop (defaults totargetsif unspecified) (Array)pathThe change in$location.path()to wait for (String, required)targetsOne or more css selectors representing click targets (Array)tooltipsTooltips to show for the correspondingselector(Array) Tooltip PropertiesselectorCSS selector to affix the tooltip to (String, required)textText to display in the tooltip (String)placementOne of top, right, bottom or left (String)
####showMessage####
The showMessage step type tells the tutorial to show a message using ui-bootstrap's $modal service
Properties
messageThe message to display (String/Object, required) If the message is an Object, the following properties are supportedmessageText to display in the tooltip (String, required)buttonTextText for the confirm button (defaults to "Continue") (String)headerText for the moda's header (no header will be displayed if unspecified) (String)
####delay####
The delay step type tells the tutorial to wait before proceeding.
Properties
delayThe delay in milliseconds to wait (String/Object, required)