简体   繁体   English

如何使用angularjs在同一屏幕上调用四个不同的页面?

[英]How can I call four different pages in same screen using angularjs?

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 ie you can change time in variable an will be reflected through out the web app.所有屏幕都将根据一些时间因素一个一个地自动更改,并且时间必须是可配置的,即您可以更改变量中的时间,并将通过网络应用程序反映出来。

You can try ng-route.你可以试试 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您可以在https://docs.angularjs.org/api/ngRoute/service/ $route 上阅读更多文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM