Skip to content

Commit

Permalink
Fix: duplicate elements using ng-if in wrapper element mihnsen#5
Browse files Browse the repository at this point in the history
  • Loading branch information
mihnsen committed May 7, 2017
1 parent bacacfb commit e3696ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
9 changes: 3 additions & 6 deletions dist/ui-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ angular.module('ui.carousel.directives').directive('uiCarousel', ['$compile', '$
onAfterChange: '&',
onInit: '&'
},
compile: function compile(el) {
link: function link($scope, el) {
var template = angular.element($templateCache.get('ui-carousel/carousel.template.html'));

// dynamic injections to override the inner layers' components
Expand All @@ -664,11 +664,8 @@ angular.module('ui.carousel.directives').directive('uiCarousel', ['$compile', '$
}
});

return function ($scope, el) {
// Compile
var compiledElement = $compile(templateInstance)($scope);
el.addClass('ui-carousel').html('').append(compiledElement);
};
var compiledElement = $compile(templateInstance)($scope);
el.addClass('ui-carousel').html('').append(compiledElement);
},


Expand Down
2 changes: 1 addition & 1 deletion dist/ui-carousel.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e3696ca

Please sign in to comment.