-2

How can I create an assignment with four screens?

  1. Screen with some text
  2. Screen with some images image
  3. Screen with a video

All the screens will be changed automatically one by one with some time factor and the time must me configurable i.e you can change time in variable an will be reflected through out the web app.

arghtype
  • 4,376
  • 11
  • 45
  • 60

1 Answers1

0

You can try ng-route.

<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-route.js"></script>

<body ng-app="myApp">

<p><a href="#/">Main</a></p>

<a href="#red">Red</a>
<a href="#green">Green</a>
<a href="#blue">Blue</a>

<div ng-view></div>

<script>
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
    $routeProvider
    .when("/", {
        templateUrl : "main.htm"
    })
    .when("/red", {
        templateUrl : "red.htm"
    })
    .when("/green", {
        templateUrl : "green.htm"
    })
    .when("/blue", {
        templateUrl : "blue.htm"
    });
});
</script>

<p>Click on the links to navigate to "red.htm", "green.htm", "blue.htm", or back to "main.htm"</p>
</body>
</html>

You can read further docs on https://docs.angularjs.org/api/ngRoute/service/$route

developer
  • 76
  • 1
  • 12
  • i already tried it ...because i am new here so i didnt posted my code ..now i m going to post...i want change of page on time interval – RAVI CHOUDHARY Feb 04 '17 at 06:29