diff --git a/dist/amd/index.js b/dist/amd/index.js index 4d075de..dc7d021 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -6,8 +6,10 @@ define(['exports', 'aurelia-templating', './animator'], function (exports, _aure exports.CssAnimator = _animator.CssAnimator; function configure(aurelia, cb) { - var animator = new _animator.CssAnimator(); + var animator = aurelia.container.get(_animator.CssAnimator); _aureliaTemplating.Animator.configureDefault(aurelia.container, animator); - cb(aurelia.container.get(_animator.CssAnimator)); + if (cb !== undefined && typeof cb === 'function') { + cb(animator); + } } }); \ No newline at end of file diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index 1da2296..c8d7168 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -10,7 +10,9 @@ var _CssAnimator = require('./animator'); exports.CssAnimator = _CssAnimator.CssAnimator; function configure(aurelia, cb) { - var animator = new _CssAnimator.CssAnimator(); + var animator = aurelia.container.get(_CssAnimator.CssAnimator); _Animator.Animator.configureDefault(aurelia.container, animator); - cb(aurelia.container.get(_CssAnimator.CssAnimator)); + if (cb !== undefined && typeof cb === 'function') { + cb(animator); + } } \ No newline at end of file diff --git a/dist/es6/index.js b/dist/es6/index.js index 709dc8d..695049a 100644 --- a/dist/es6/index.js +++ b/dist/es6/index.js @@ -4,7 +4,9 @@ import {CssAnimator} from './animator'; export {CssAnimator} from './animator'; export function configure(aurelia, cb){ - var animator = new CssAnimator(); + var animator = aurelia.container.get(CssAnimator); Animator.configureDefault(aurelia.container, animator); - cb(aurelia.container.get(CssAnimator)); + if(cb !== undefined && typeof(cb) === 'function') { + cb(animator); + } } diff --git a/dist/system/index.js b/dist/system/index.js index 3046fa7..be99e9e 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -4,9 +4,11 @@ System.register(['aurelia-templating', './animator'], function (_export) { _export('configure', configure); function configure(aurelia, cb) { - var animator = new CssAnimator(); + var animator = aurelia.container.get(CssAnimator); Animator.configureDefault(aurelia.container, animator); - cb(aurelia.container.get(CssAnimator)); + if (cb !== undefined && typeof cb === 'function') { + cb(animator); + } } return { diff --git a/src/index.js b/src/index.js index 709dc8d..695049a 100644 --- a/src/index.js +++ b/src/index.js @@ -4,7 +4,9 @@ import {CssAnimator} from './animator'; export {CssAnimator} from './animator'; export function configure(aurelia, cb){ - var animator = new CssAnimator(); + var animator = aurelia.container.get(CssAnimator); Animator.configureDefault(aurelia.container, animator); - cb(aurelia.container.get(CssAnimator)); + if(cb !== undefined && typeof(cb) === 'function') { + cb(animator); + } }