diff --git a/.gitignore b/.gitignore
index 78d41c3..b586efa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,9 @@
bower_components/
.idea/
node_modules
-*.iml
\ No newline at end of file
+*.iml
+typings/
+*.map
+*.js
+src/*.js
+.tscache/
diff --git a/Gruntfile.js b/Gruntfile.js
index 5fb5ea4..9448ac5 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,39 +1,59 @@
-module.exports = function(grunt) {
+module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
+ grunt.loadNpmTasks("grunt-tslint");
+ grunt.loadNpmTasks('grunt-ts');
// Project configuration.
grunt.initConfig({
connect: {
server: {
options: {
- port: 8000,
- base: '.',
- keepalive: true
+ port: 8000,
+ base: '.',
+ keepalive: true
}
}
},
pkg: grunt.file.readJSON('package.json'),
+ ts: {
+ default: {
+ src: ["src/**/*.ts", "!node_modules/**"],
+ options: {
+ module: "amd",
+ moduleResolution: "node",
+ declaration: true,
+ compiler: './node_modules/typescript/bin/tsc'
+ },
+ tsconfig: 'tsconfig.json',
+ }
+ },
uglify: {
options: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n',
sourceMap: true
},
build: {
- src: 'src/angular-intro.js',
+ src: ['src/ng-intro.component.js'],
dest: 'build/angular-intro.min.js'
}
},
- jshint: {
- lib: {
- options: {},
- src: ['src/*.js']
+ tslint: {
+ options: {
+ configuration: "tslint.json",
+ force: false,
+ fix: false
+ },
+ files: {
+ src: [
+ "src/ng-intro.component.ts"
+ ]
}
},
watch: {
scripts: {
- files: 'src/*.js',
- tasks: ['jshint', 'uglify'],
+ files: 'src/*.ts',
+ tasks: ['ts', 'tslint', 'uglify'],
options: {
interrupt: true
}
@@ -48,8 +68,8 @@ module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
// Default task(s).
- grunt.registerTask('default', ['jshint', 'uglify']);
+ grunt.registerTask('default', ['ts', 'tslint', 'uglify']);
// Test
- grunt.registerTask('test', ['jshint']);
+ grunt.registerTask('test', ['tslint']);
};
diff --git a/README.md b/README.md
index 01fcdfd..8607717 100644
--- a/README.md
+++ b/README.md
@@ -133,15 +133,14 @@ alternatively as Service, [as shown here](http://plnkr.co/edit/4JdONL)
If you want to build or contribute, first, get the node modules needed (grunt, bower)
- npm install
+ npm install
+ p.s.: this will run `bower install` after completes :)
-Next, use bower to get the JS libraries needed
- node_modules/.bin/bower install
+Then, get grunt to build the typescript into .js and the minified angular-intro.min.js
-Then, whenever you make any changes, get grunt to build the minified angular-intro.min.js
-
- node_modules/.bin/grunt
+ node_modules/.bin/grunt watch
+ p.s.: for faster build use `tsc --watch`, but you need run grunt after finish
Finally, view the demo page to make sure everything's working; start a web server:
@@ -151,7 +150,6 @@ And browse to `http://localhost:8000/example/index.html`
-
## License
Same as intro.js, this is [AGPL](LICENSE)
diff --git a/build/angular-intro.min.js b/build/angular-intro.min.js
index 2490f20..5560621 100644
--- a/build/angular-intro.min.js
+++ b/build/angular-intro.min.js
@@ -1,4 +1,4 @@
-/*! angular-intro.js - v3.1.3 - 2017-03-16 */
+/*! angular-intro.js - v3.2.0 - 2017-03-25 */
-!function(a,b){"function"==typeof define&&define.amd?define(["angular","intro.js"],b):"object"==typeof exports?module.exports=b(require("angular"),require("intro.js")):a.angularIntroJs=b(a.angular,a.introJs)}(this,function(a,b){function c(){this.message="Intro.js is not available. Make sure it is properly loaded.",this.name="IntroJsNotAvailable"}"object"==typeof b&&(b=b.introJs);var d=a.module("angular-intro",[]);return d.factory("ngIntroService",["$q",function(d){function e(b,c){a.isFunction(c)&&(B[b]=c)}function f(a){delete B[a]}function g(a){A.setOptions(a)}function h(a){"number"==typeof a?A.start().goToStep(a):A.start(),i("open")}function i(b){for(var c in B)B.hasOwnProperty(c)&&a.isFunction(B[c])&&B[c](b)}function j(){A.exit(),i("closed")}function k(){A.previousStep(),i("open")}function l(){A.nextStep(),i("open")}function m(){A.refresh()}function n(b){return A.oncomplete(function(){a.isFunction(b)&&b(),i("closed")})}function o(b){return A.onbeforechange(function(c){a.isFunction(b)&&b(c)})}function p(b){return A.onchange(function(c){a.isFunction(b)&&b(c)})}function q(c){return"undefined"!=typeof A&&A.exit(),A=new b,i("closed"),a.isFunction(c)&&c(),A}function r(b){return A.onafterchange(function(c){a.isFunction(b)&&b(c)})}function s(b){return A.onexit(function(){i("closed"),a.isFunction(b)&&b()})}function t(){return A.addHints()}function u(){return A.showHints()}function v(a){return A.hideHint(a)}function w(){return A.hideHints()}function x(b){A.onhintclick(function(){a.isFunction(b)&&b()})}function y(b){return A.onhintclose(function(){a.isFunction(b)&&b()})}function z(b){return A.onhintclose(function(){a.isFunction(b)&&b()})}if("function"!=typeof b)throw new c;var A,B={},C={addListener:e,removeListener:f,setOptions:g,start:h,exit:j,clear:q,previous:k,next:l,refresh:m,onComplete:n,onExit:s,onBeforeChange:o,onAfterChange:r,onChange:p,addHints:t,showHints:u,hideHint:v,hideHints:w,onHintClick:x,onHintClose:y,onHintsAdded:z};return Object.defineProperty(C,"intro",{get:function(){return A},enumerable:!0,configurable:!0}),q(),C}]).directive("ngIntroDisableButton",["ngIntroService","$compile",function(a,b){var c=0;return{restrict:"A",priority:1,scope:{introDisableButton:"="},link:function(b,d,e){var f="disabledBtn"+c++;a.addListener(f,function(a){"open"===a?e.$set("disabled","disabled"):(delete e.disabled,d.removeAttr("disabled"))}),b.$on("$destroy",function(){a.removeListener(f)})}}}]).directive("ngIntroOptions",["$timeout","ngIntroService",function(b,c){return{restrict:"A",scope:{ngIntroMethod:"=",ngIntroExitMethod:"=?",ngIntroNextMethod:"=?",ngIntroPreviousMethod:"=?",ngIntroRefreshMethod:"=?",ngIntroOptions:"=",ngIntroOncomplete:"=",ngIntroOnexit:"=",ngIntroOnchange:"=",ngIntroOnbeforechange:"=",ngIntroOnafterchange:"=",ngIntroAutostart:"=",ngIntroAutorefresh:"=",ngIntroHintsMethod:"=?",ngIntroOnhintsadded:"=",ngIntroOnhintclick:"=?",ngIntroOnhintclose:"=?",ngIntroShowHint:"=?",ngIntroShowHints:"=?",ngIntroHideHint:"=?",ngIntroHideHints:"=?"},link:function(d,e,f){function g(){for(var a=0;a>h.length;a++)h[a]()}var h=[];d.ngIntroOncomplete&&c.onComplete(d.ngIntroOncomplete),d.ngIntroOnexit&&c.onExit(d.ngIntroOnexit),d.ngIntroOnbeforechange&&c.onBeforeChange(d.ngIntroOnbeforechange),d.ngIntroOnchange&&c.onChange(d.ngIntroOnchange),d.ngIntroOnafterchange&&c.onAfterChange(d.ngIntroOnafterchange),d.ngIntroMethod=function(a){c.setOptions(d.ngIntroOptions),c.start(a)},d.ngIntroHintsMethod=function(){c.setOptions(d.ngIntroOptions),c.start(step),d.ngIntroOnhintsadded&&c.onHintsAdded(d.ngIntroOnbeforechange),d.ngIntroOnhintclick&&c.onHintClick(d.ngIntroOnbeforechange),d.ngIntroOnhintclose&&c.onHintClick(d.ngIntroOnbeforechange),intro.addHints()},d.ngIntroShowHint=function(a){c.showHint(a)},d.ngIntroShowHints=function(){c.showHints()},d.ngIntroHideHint=function(a){c.hideHint(a)},d.ngIntroHideHints=function(){c.hideHints()},d.ngIntroNextMethod=function(){c.next()},d.ngIntroPreviousMethod=function(){c.previous()},d.ngIntroExitMethod=function(b){c.exit(),a.isFunction(b)&&b()},d.ngIntroRefreshMethod=function(){c.refresh()};var i=d.$watch("ngIntroAutostart",function(){d.ngIntroAutostart&&b(function(){d.ngIntroMethod()}),i()});h.push(d.$on("$locationChangeStart",function(){c.exit()})),h.push(d.$on("$locationChangeSuccess",function(){c.exit()})),d.ngIntroAutorefresh&&h.push(d.$watch(function(){c.refresh()})),h.push(d.$on("$destroy",function(){c.exit()})),d.$on("$destroy",function(){g()})}}}]),d});
+!function(a,b){"function"==typeof window.define&&window.define.amd?window.define(["angular","intro.js"],b):"object"==typeof window.exports?window.module.exports=b(window.require("angular"),window.require("intro.js")):a.angularIntroJs=b(a.angular,a.introJs)}(this,function(a,b){var c={open:"open",closed:"closed"},d="angular-intro",e={},f=function(){function d(){this.intro=b()}return d.prototype.addListener=function(b,c){a.isFunction(c)&&(e[b]=c)},d.prototype.removeListener=function(a){delete e[a]},d.prototype.notifyListeners=function(b){for(var c in e)e.hasOwnProperty(c)&&a.isFunction(e[c])&&e[c](b)},d.prototype.setOptions=function(a){return this.intro.setOptions(a)},d.prototype.start=function(a){return"number"==typeof a?this.intro.start().goToStep(a):this.intro.start(),this.notifyListeners(c.open),this.intro},d.prototype.exit=function(){return this.notifyListeners(c.closed),this.intro.exit()},d.prototype.clear=function(d){return"undefined"!=typeof this.intro&&this.intro.exit(),this.intro=b(),this.notifyListeners(c.closed),a.isFunction(d)&&d(),this.intro},d.prototype.addHints=function(){return this.intro.addHints()},d.prototype.showHint=function(a){return this.intro.showHint(a)},d.prototype.showHints=function(){return this.intro.showHints()},d.prototype.hideHint=function(a){return this.intro.hideHint(a)},d.prototype.hideHints=function(){return this.intro.hideHints()},d.prototype.previous=function(){return this.notifyListeners(c.open),this.intro.previousStep()},d.prototype.next=function(){return this.notifyListeners(c.open),this.intro.nextStep()},d.prototype.refresh=function(){return this.intro.refresh()},d.prototype.onComplete=function(b){var d=this;return this.intro.oncomplete(function(){a.isFunction(b)&&b(),d.notifyListeners(c.closed)})},d.prototype.onExit=function(b){var d=this;return this.intro.onexit(function(){d.notifyListeners(c.closed),a.isFunction(b)&&b()})},d.prototype.onBeforeChange=function(b){return this.intro.onbeforechange(function(c){a.isFunction(b)&&b(c)})},d.prototype.onChange=function(b){return this.intro.onchange(function(c){a.isFunction(b)&&b(c)})},d.prototype.onAfterChange=function(b){return this.intro.onafterchange(function(c){a.isFunction(b)&&b(c)})},d.prototype.onHintClick=function(b){return this.intro.onhintclick(function(){a.isFunction(b)&&b()})},d.prototype.onHintClose=function(b){return this.intro.onhintclose(function(){a.isFunction(b)&&b()})},d.prototype.onHintsAdded=function(b){return this.intro.onhintclose(function(){a.isFunction(b)&&b()})},d}(),g=function(){function b(b,c){var d=this;this.restrict="A",this.scope={ngIntroMethod:"=",ngIntroExitMethod:"=?",ngIntroNextMethod:"=?",ngIntroPreviousMethod:"=?",ngIntroRefreshMethod:"=?",ngIntroOptions:"=",ngIntroOncomplete:"=",ngIntroOnexit:"=",ngIntroOnchange:"=",ngIntroOnbeforechange:"=",ngIntroOnafterchange:"=",ngIntroAutostart:"=",ngIntroAutorefresh:"=",ngIntroHintsMethod:"=?",ngIntroOnhintsadded:"=",ngIntroOnhintclick:"=?",ngIntroOnhintclose:"=?",ngIntroShowHint:"=?",ngIntroShowHints:"=?",ngIntroHideHint:"=?",ngIntroHideHints:"=?"},this.destroy=[],this.link=function(e,f,g){function h(){for(var a=0,b=this.destroy;a