Toggle navigation
P3X GitList Snapshot
GitHub
Repo
Changelog
To do
Releases
Themes
Change log
Loading change log ...
To do ...
Loading todo ...
browsing:
1fab801c4042297b32d35c3c87c7553edec68511
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: 15
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({ selector: 'p3x-ng2-compile-html',
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;
503f2b36
data: string = `<div>Done</div><a href="javascript:void(0);" (click)="ref.alert('ok')">If click works it says OK!</a>`; ref: Page; constructor( private compileHtmlService: CompileHtmlService ) { this.ref = this; }
16533ae5
alert(string: string ) { alert(string); }
503f2b36
ngOnInit() {
16533ae5
this.compileHtmlService.compile({
503f2b36
template: this.data,
16533ae5
container: this.container, ref: this, }) } }