Last active
August 29, 2015 13:55
-
-
Save stuf/8768325 to your computer and use it in GitHub Desktop.
slideshow angular test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// window.app is initialized as: window.app = window.app || angular.module('appName', []); | |
window.app.directive( | |
'soluSlideshow', | |
function () { | |
'use strict'; | |
var defaultConfig = { | |
infiniteLoop: false | |
}; | |
var callback = function link( scope, element, attrs ) { | |
var _options = $.extend( {}, defaultConfig, { | |
'pager': (attrs['showPager'] != null && attrs['showPager'] === 'show'), | |
'controls': (attrs['showControls'] != null && attrs['showControls'] === 'show') | |
} ); | |
$( element ).bxSlider( _options ); | |
}; | |
return { | |
restrict: 'A', | |
scope: { | |
showPager: '=', | |
showControls: '=' | |
}, | |
link: callback | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment