Testing my controller functionality has been a challenge. I attempted to use an alert function to check if the controller is working properly, but unfortunately, nothing seemed to happen.
JS
routerApp.controller('myCtrl', ["$scope", "$http",
"$timeout", function($scope, $http, $timeout){
$http({
method: 'GET',
url: 'image.json'
}).then(function successCallback(response){
$scope.images = response.data.items;
console.log(response.data.items);
$timeout(function(){
$("#lightSlider").lightSlider({
item:1,
auto: true,
loop:true,
speed:1000,
pause:3000,
});
},0);
}, function errorCallback(response){
alert("Something went wrong!");
});
}]);
HTML
<div class="banner">
<ul id="lightSlider">
<li ng-repeat="image in images">
<img ng-src="{{image.img}}" />
</li>
</ul>
</div>