Skip to content
This repository was archived by the owner on May 4, 2022. It is now read-only.

Set options to timeout, guaranteeing the variable "options" has been loaded #303

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions js/angular/directive/slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,18 @@ function($animate, $timeout, $compile) {
return _this.__slider;
};

var options = $scope.options || {};
$timeout(function() {
var options = $scope.options || {};

var newOptions = angular.extend({
pagination: $element.children().children()[1],
paginationClickable: true,
lazyLoading: true,
preloadImages: false
}, options);
var newOptions = angular.extend({
pagination: $element.children().children()[1],
paginationClickable: true,
lazyLoading: true,
preloadImages: false
}, options);

this._options = newOptions;
this._options = newOptions;

$timeout(function() {
var slider = new ionic.views.Swiper($element.children()[0], newOptions, $scope, $compile);

$scope.$emit("$ionicSlides.sliderInitialized", { slider: slider });
Expand Down