-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
28 lines (21 loc) · 776 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
angular.module('slider', []);
angular.module('slider').controller('sliderController', ['$scope', function ($scope) {
'use strict';
$scope.pages = ['PAGE 1', 'PAGE 2', 'PAGE 3'];
}]);
angular.module('slider').directive('dynamicSlider', ['$timeout', function ($timeout) {
'use strict';
return {
template: '<div class="swiper-container"><div class="swiper-wrapper" data-ng-transclude></div></div>',
transclude: true,
replace: true,
link: function (scope, element, attrs) {
$timeout(function () {
var mySwiper = new Swiper(element[0], {
mode: 'horizontal',
loop: true
});
});
}
};
}]);