Wie ich in Angular2 und Dart diesen Code in angular1 umschreiben kann:
$interval(function() {
if($scope.carouselIndex < $scope.showcases.length -1){
$scope.carouselIndex = $scope.carouselIndex + 1;
} else {
$scope.carouselIndex = 0;
}
}, properties.delay);
Ich habe versucht, auf diese Weise aber nicht funktioniert hat:
carouselIndex = 0;
for(int i=0; i<contents.size(); i++){
if(carouselIndex < contents.length -1){
setTimeout(function() {
carouselIndex = carouselIndex + 1;
}, 1000);
} else {
carouselIndex = 0;
}
}
Irgendeine Idee? Dank