Toggle navigation
P3X GitList Snapshot
GitHub
Repo
Changelog
To do
Releases
Themes
Change log
Loading change log ...
To do ...
Loading todo ...
browsing:
f827c398ca4108928810123a0df407808faafa33
Branches
master
Tags
1.1.129-287
1.1.113-149
1.1.108-143
1.1.95-138
1.1.92-119
1.0.35-18
1.0.13-14
Files
Commits
Log
Graph
Stats
angular-compile.git
test
angular2
app
Page.ts
RSS
Git
Fetch origin
Download
ZIP
TAR
Clone
Raw
View
History
Clone
SSH
HTTPS
Blames found: 23
Mode: application/typescript
Binary: false
Hang on, we reloading big blames...
16533ae5
import { Component, Injectable, ViewChild, ViewContainerRef,
503f2b36
OnInit
16533ae5
} from '@angular/core';
1fab801c
import {CompileHtmlService } from '../../../src';
16533ae5
@Component({
e6214744
selector: 'p3x-ng2-compile-html-text',
503f2b36
template: ` <div #container>loading ...</div> <div [p3xCompileHtml]="data" [p3xCompileHtmlRef]="ref">loading ...</div> `,
16533ae5
}) @Injectable()
503f2b36
export class Page implements OnInit {
16533ae5
@ViewChild('container', {read: ViewContainerRef}) container: ViewContainerRef;
976a970c
data: string;
503f2b36
ref: Page;
976a970c
counter : number = 0;
503f2b36
constructor( private compileHtmlService: CompileHtmlService ) { this.ref = this;
976a970c
this.update(); } private update() { this.counter = this.counter + 1; this.data = `<div>Done</div><a href="javascript:void(0);" (click)="ref.alert('ok')">If click works it says OK!</a>${this.counter}`;
503f2b36
}
16533ae5
alert(string: string ) { alert(string);
976a970c
this.update();
16533ae5
}
503f2b36
ngOnInit() {
16533ae5
this.compileHtmlService.compile({
503f2b36
template: this.data,
16533ae5
container: this.container, ref: this, }) } }