UNPKG

2.37 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var __metadata = (this && this.__metadata) || function (k, v) {
9 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10};
11var core_1 = require('@angular/core');
12var TestComponent = (function () {
13 function TestComponent(some) {
14 if (some === void 0) { some = 'something'; }
15 this.hostprop = 'clicked it';
16 this.someValue = 1;
17 console.log(some);
18 }
19 TestComponent.prototype.clicked = function () {
20 console.log(this.hostprop);
21 };
22 TestComponent.prototype.ngOnInit = function () {
23 var outerScope = this;
24 setInterval(function () {
25 outerScope.someValue++;
26 }, 3000);
27 };
28 TestComponent = __decorate([
29 core_1.Component({
30 selector: 'test',
31 template: "<div>\n <p>test component</p>\n </div>"
32 }),
33 __metadata('design:paramtypes', [String])
34 ], TestComponent);
35 return TestComponent;
36}());
37exports.TestComponent = TestComponent;
38var AppComponent = (function () {
39 function AppComponent() {
40 this.testComponent = TestComponent;
41 this.template1 = "<p (click)=\"clicked()\">the new template1{{someValue}}</p>";
42 this.template2 = "<p (click)=\"clicked()\">the newer template</p>";
43 }
44 AppComponent = __decorate([
45 core_1.Component({
46 selector: 'app',
47 template: "<div>\n <templation [component]=\"testComponent\" [template]=\"template1\" ></templation>\n <templation [component]=\"testComponent\" [template]=\"template2\" ></templation>\n </div>"
48 }),
49 __metadata('design:paramtypes', [])
50 ], AppComponent);
51 return AppComponent;
52}());
53exports.AppComponent = AppComponent;
54//# sourceMappingURL=app.component.js.map
\No newline at end of file