/
app.js
38 lines (38 loc) · 1.83 KB
/
app.js
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
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
if (typeof __metadata !== "function") __metadata = function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
/// <reference path="typings/angular2/angular2.d.ts" />
var angular2_1 = require('angular2/angular2');
var FriendsService = (function () {
function FriendsService() {
this.names = ["Alice", "Aarav", "Martín", "Shannon", "Ariana", "Kai"];
}
return FriendsService;
})();
var DisplayComponent = (function () {
function DisplayComponent(friendsService) {
this.myName = "Alice";
this.names = friendsService.names;
}
DisplayComponent = __decorate([
angular2_1.Component({
selector: 'display',
injectables: [FriendsService]
}),
angular2_1.View({
template: "\n <p>My name: {{ myName }}</p>\n <p>Friends:</p>\n <ul>\n <li *for=\"#name of names\">\n {{ name }}\n </li>\n </ul>\n <p *if=\"names.length > 3\">You have many friends!</p>\n ",
directives: [angular2_1.For, angular2_1.If]
}),
__metadata('design:paramtypes', [FriendsService])
], DisplayComponent);
return DisplayComponent;
})();
angular2_1.bootstrap(DisplayComponent);