From 603e18100c722b623631818590ba81f447c9bef4 Mon Sep 17 00:00:00 2001 From: Cherry Date: Tue, 23 May 2017 22:54:59 +0800 Subject: [PATCH 1/3] added gitignore file --- .gitignore | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6dbe9ac --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +bower_components +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history From a7041b5565fd8f1b71310e817a4cff76a3cfb14a Mon Sep 17 00:00:00 2001 From: Cherry Date: Tue, 23 May 2017 22:55:24 +0800 Subject: [PATCH 2/3] added bower dependency --- bower.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index ddb47d5..45b4dff 100644 --- a/bower.json +++ b/bower.json @@ -20,5 +20,8 @@ "bower_components", "test", "tests" - ] + ], + "dependencies": { + "owl-carousel": "^1.3.2" + } } From c93f4d1fc070013c183ca39f7265e94c7a3b1547 Mon Sep 17 00:00:00 2001 From: Cherry Date: Tue, 23 May 2017 23:05:47 +0800 Subject: [PATCH 3/3] fix for items not showing --- src/angular-owl-carousel.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/angular-owl-carousel.js b/src/angular-owl-carousel.js index 53ed466..46eea3b 100644 --- a/src/angular-owl-carousel.js +++ b/src/angular-owl-carousel.js @@ -84,26 +84,28 @@ return { restrict: 'A', scope: { - owlOptions: '=owlOptions' + owlOptions: '=owlOptions', + owlCarousel: '=owlCarousel' }, transclude: true, link: function (scope, element, attributes, controller, $transclude) { var options = {}, $element = $(element), - owlCarousel = null, - propertyName = attributes.owlCarousel; + owlCarousel = null; for (var optionValue in owlOptions) { - var currentOptionValue = owlOptions[optionValue]; - if (scope.owlOptions[currentOptionValue] !== undefined) { - options[currentOptionValue] = scope.owlOptions[currentOptionValue]; - } + if (owlOptions.hasOwnProperty(optionValue)) { + var currentOptionValue = owlOptions[optionValue]; + if (scope.owlOptions[currentOptionValue] !== undefined) { + options[currentOptionValue] = scope.owlOptions[currentOptionValue]; + } + } } element.addClass('owl-carousel'); - scope.$watchCollection(propertyName, function (newItems) { + scope.$watchCollection('owlCarousel', function (newItems) { if (owlCarousel) { owlCarousel.destroy();