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){
|
||||
var index = -1;
|
||||
var templates = [
|
||||
"/static/html/test1.html",
|
||||
"/static/html/test2.html",
|
||||
"/static/html/test3.html",
|
||||
{
|
||||
template: "/static/html/test1.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(){
|
||||
index = (index + 1) % templates.length;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user