created demo of dynamic templates
This commit is contained in:
@@ -1 +1 @@
|
|||||||
<h1>testi1</h1>
|
<h1>testi1 {{ testparam }}</h1>
|
||||||
|
|||||||
@@ -3,9 +3,17 @@ var app = angular.module('infoApp', []);
|
|||||||
app.controller('infoscreen_main', function($scope, $http,$timeout){
|
app.controller('infoscreen_main', function($scope, $http,$timeout){
|
||||||
var index = -1;
|
var index = -1;
|
||||||
var templates = [
|
var templates = [
|
||||||
"/static/html/test1.html",
|
{
|
||||||
"/static/html/test2.html",
|
template: "/static/html/test1.html",
|
||||||
"/static/html/test3.html",
|
onload: function(){$scope.testparam = "foo";}
|
||||||
|
},{
|
||||||
|
template: "/static/html/test2.html"
|
||||||
|
},{
|
||||||
|
template: "/static/html/test1.html",
|
||||||
|
onload: function(){$scope.testparam = "bar";}
|
||||||
|
},{
|
||||||
|
template: "/static/html/test3.html"
|
||||||
|
},
|
||||||
];
|
];
|
||||||
$scope.next = function(){
|
$scope.next = function(){
|
||||||
index = (index + 1) % templates.length;
|
index = (index + 1) % templates.length;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="jumbotron" ng-controller="infoscreen_main">
|
<div class="jumbotron" ng-controller="infoscreen_main">
|
||||||
<div id="infocontent" ng-include="active"></div>
|
<div id="infocontent" ng-include="active.template" onload="active.onload()"></div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user