Thanks Sander, I just needed to get a feel for the conditional syntax in
Angular.
regards,
Tony
On Saturday, September 17, 2016 at 9:14:47 PM UTC-4, Tony Starke wrote:
> *Ok, I would like to switch multiple div layers every 8 seconds, using a
> interval service loop. Each div layer should show every 8 seconds starting
> from div1 and ending with div4, then loops back to div1.Here is my code:*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *<!DOCTYPE HTML><html><head> <meta http-equiv="content-type"
> content="text/html" /> <meta name="author" content="Portal Associates"
> /> <title>Untitled 2</title> <script type="text/javascript"
> src="angular.min.js"></script> <script type="text/javascript"
> src="angular-animate.js"></script></head><body ng-app="bgApp">This should
> change every 8 seconds!<div id="view" ng-controller="switchDiv" > <div
> ng-show="div1" ng-switch-when="view= 1" > This is Div 1!</div><div
> ng-show="div2" ng-switch-when="view= 2" > This is Div 2!</div><div
> ng-show="div3" ng-switch-when="view= 3" > This is Div 3!</div><div
> ng-show="div4" ng-switch-when="view= 0" > This is Div
> 4!</div></div><script>var app = angular.module('bgApp',
> ['ngAnimate']);app.controller('switchDiv', function($scope, $interval) {
> $scope.view = $scope.div1[0]; $scope.view = $scope.div2[1];
> $scope.view = $scope.div3[2]; $scope.view = $scope.div4[3];
> $interval(function () { $scope.view++; },
> 8000);});</script></body></html>I know I am close, but the bolean syntax
> still escapes me since I am new to angular.thanks in advance,Batoe*
>
--
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.