A simple Angular JS wrapper for TypeIt, a jQuery plugin by alexmacarthur. Check out the demo here.
- Make sure you have jQuery and TypeIt included on your page
<script src="./somewhere/jquery-2.1.4.min.js"></script>
<script src="./somewhere/typeit.js"></script>
- Include
angular-typeit.json your page
<script src="./somewhere/angular-typeit.js"></script>
- Add
ab.Typeitas a dependency to your project
angular.module('myAmazingApp', ['ab.Typeit'])
For basic usage, simply use ab-typeit and pass a string or an array of strings from your controller:
<p ab-typeit="ctrl.myStrings"></p>
For additional options, use any of the attributes described below.
angular-typeit currently supports the default options available for TypeIt, which can be set as attributes on the element:
<p ab-typeit="ctrl.myStrings" typeit-break-lines="false" typeit-loop="true"></p>
List of supported attributes:
typeit-looptypeit-loop-delaytypeit-break-linestypeit-speedtypeit-life-liketypeit-cursortypeit-cursor-speedtypeit-start-delaytypeit-break-delay
The full description and default values can be found on the TypeIt plugin page.