Hi Tony,
Have a look at this:
<div id="view" ng-controller="switchDiv" ng-switch="view">
<div ng-switch-when="1"> This is Div 1!</div>
<div ng-switch-when="2"> This is Div 2!</div>
<div ng-switch-when="3"> This is Div 3!</div>
<div ng-switch-when="0"> This is Div 4!</div>
</div>
<script>
var app = angular.module('bgApp', ['ngAnimate']);
app.controller('switchDiv', function($scope, $interval) {
$scope.view = 1
$interval(function() {
$scope.view++;
if ($scope.view>3) {
$scope.view=0;
}
}, 2000);
});
</script>
See where you went wrong?
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.