diff --git a/angular-peity.js b/angular-peity.js index cd36925..8112880 100644 --- a/angular-peity.js +++ b/angular-peity.js @@ -41,8 +41,13 @@ var buildChartDirective = function(chartType) { jQuery( span ).change(); }, true); + var OptsWatcher = scope.$watch('options', function () { + jQuery(span).peity(chartType, options); + }, true); + scope.$on('$destroy', function(){ watcher(); + OptsWatcher(); }); jQuery(window).resize(function() { @@ -72,4 +77,4 @@ angularPeity.directive( 'lineChart', function () { return buildChartDirective( "line" ); -} ); +} ); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..e06ef33 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,18 @@ +{ + "name": "angular-peity", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "jquery": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", + "integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==" + }, + "peity": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/peity/-/peity-3.3.0.tgz", + "integrity": "sha512-4QUbLwDpmBFS/f0RdLODU1HgLHJJ2qo9fruRRNFB3DRNi8MCb3yIMLyNUwOLGcMwkN9uqQKacjKJEM7/TZQkFw==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..1db0d2d --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "angular-peity", + "version": "1.0.0", + "description": "Fork of https://github.com/projectweekend/angular-peity with package.json", + "main": "angular-peity.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/kirantambe/angular-peity.git" + }, + "keywords": [ + "angular", + "peity", + "charts" + ], + "author": "Brian Hines ", + "license": "ISC", + "bugs": { + "url": "https://github.com/kirantambe/angular-peity/issues" + }, + "homepage": "https://github.com/kirantambe/angular-peity#readme", + "dependencies": { + "jquery": "^3.3.1", + "peity": "^3.3.0" + } +}