1 | "use strict";
|
2 | var __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 | };
|
8 | var __metadata = (this && this.__metadata) || function (k, v) {
|
9 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10 | };
|
11 | var core_1 = require('@angular/core');
|
12 | var TestComponent = (function () {
|
13 | function TestComponent() {
|
14 | this.hostprop = 'clicked it';
|
15 | this.someValue = 1;
|
16 | }
|
17 | TestComponent.prototype.clicked = function () {
|
18 | console.log(this.hostprop);
|
19 | };
|
20 | TestComponent.prototype.ngOnInit = function () {
|
21 | var outerScope = this;
|
22 | setInterval(function () {
|
23 | outerScope.someValue++;
|
24 | console.log(outerScope.someValue);
|
25 | }, 3000);
|
26 | };
|
27 | TestComponent = __decorate([
|
28 | core_1.Component({
|
29 | selector: 'test',
|
30 | template: "<div>\n <p>test component</p>\n </div>"
|
31 | }),
|
32 | __metadata('design:paramtypes', [])
|
33 | ], TestComponent);
|
34 | return TestComponent;
|
35 | }());
|
36 | exports.TestComponent = TestComponent;
|
37 | var AppComponent = (function () {
|
38 | function AppComponent() {
|
39 | this.testComponent = TestComponent;
|
40 | this.template1 = "<p (click)=\"clicked()\">the new template1{{someValue}}</p>";
|
41 | this.template2 = "<p (click)=\"clicked()\">the newer template</p>";
|
42 | }
|
43 | AppComponent = __decorate([
|
44 | core_1.Component({
|
45 | selector: 'app',
|
46 | template: "<div>\n <templation [component]=\"testComponent\" [template]=\"template1\" ></templation>\n <templation [component]=\"testComponent\" [template]=\"template2\" ></templation>\n </div>"
|
47 | }),
|
48 | __metadata('design:paramtypes', [])
|
49 | ], AppComponent);
|
50 | return AppComponent;
|
51 | }());
|
52 | exports.AppComponent = AppComponent;
|
53 |
|
\ | No newline at end of file |