forked from thelgevold/angular-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgrade.html
84 lines (62 loc) · 2.7 KB
/
upgrade.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<html>
<head>
<link href="site.css?v=1" rel="stylesheet">
<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="https://code.angularjs.org/1.4.7/angular.min.js"></script>
<script>
angular.module('angular-legacy',[]);
angular.module('angular-legacy').controller('testController', function(messageService){
this.message = 'NgUpgrade';
this.newMessage = '';
this.sendMessage = function() {
messageService.sendMessage('Hello new Angular! This is Old Angular', 'old');
};
var vm = this;
messageService.getMessages()
.filter(function(data) {
return data.key === 'new';
})
.subscribe(function(data) {
vm.newMessage = data.message;
});
this.operands = {op1:10,op2:20};
this.value = {current:100, previous:null};
this.increment = function(){
this.operands.op1 += 1;
this.operands.op2 += 1;
};
});
</script>
</head>
<body>
<div class="container">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div>
<ul class="nav navbar-nav">
<li><a href="http://www.syntaxsuccess.com" class="link">Home</a></li>
<li><a href="/angular-2-samples" class="link">About</a></li>
<li><a href="/angular-2-samples/#/demo/spreadsheet" class="link">Demos</a></li>
<!--<li><a href="components/web-workers/web-worker-demo.html" class="link">Web Workers</a></li>-->
<li class="active"><a href="upgrade.html" class="link">NgUpgrade</a></li>
</ul>
</div>
</div>
</nav>
<div ng-controller="testController as testController">
<editor></editor>
<algorithms></algorithms>
<survey></survey>
<h1>Pub Sub Messages</h1>
<div>{{testController.newMessage}}</div>
<message></message>
<button ng-click="testController.sendMessage()">Send Message From Old Angular</button>
<br></br>
</div>
</div>
<script src="dist/upgrade-build.js"></script>
</body>
</html>