Toggle navigation
P3X GitList Snapshot
GitHub
Repo
Changelog
To do
Releases
Themes
Change log
Loading change log ...
To do ...
Loading todo ...
browsing:
fe52c674a2f5ed94f07b8a2412652c63468d1c01
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
src
app
app.component.ts
RSS
Git
Fetch origin
Download
ZIP
TAR
Clone
Raw
View
History
Clone
SSH
HTTPS
Blames found: 25
Mode: application/typescript
Binary: false
Hang on, we reloading big blames...
5c3da6ad
import {Component} from '@angular/core';
9f225ca9
import packageInfo from '../../package.json';
5c3da6ad
import { MatButtonModule } from "@angular/material/button"; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent {
9f225ca9
version = packageInfo.version
5c3da6ad
data1: string; data2: string = 'init';
96844f33
data3: string = '<span class="p3x-ng-compile-template">Just simple string</span><span class="p3x-ng-compile-template-intent">info</span>';
5c3da6ad
counter1: number = 0; counter2: number = 0; interval: any; dataRouterLink: string = '' compileForm: string = `` dataMaterialDefault: string = `
96844f33
<button mat-button mat-flat-button color="accent" (click)="context.randomRouterLinkJit()">Generate new router link</button>
5c3da6ad
` dataMaterial: string = `
96844f33
<button mat-button mat-flat-button color="accent" (click)="context.randomRouterLinkJit()">Generate new router link</button>
5c3da6ad
` dataMaterialModule: any = { // schemas: [CUSTOM_ELEMENTS_SCHEMA], // declarations: [], imports: [ MatButtonModule ], exports: [] } constructor( // private compileHtmlService: CompileService ) { } private update1() { this.counter1++; this.data1 = `
96844f33
<div>P3X Angular Compile</div><button mat-button mat-flat-button color="accent" id="button-container" href="javascript:void(0);" (click)="context.update1()">Click me via Angular compile!</button> <div id="counter-container" class="p3x-ng-compile-template-intent">{{ context.counter1}}</div>
5c3da6ad
`; } public formClick() { alert('form click'); } private update2() { this.counter2++; this.data2 = `
13cea24f
<div>Attribute</div><button mat-button mat-flat-button color="accent" id="button-attribute" href="javascript:void(0);" (click)="context.update2()">Click me via an other attribute!</button>
96844f33
<div id="counter-attribute" class="p3x-ng-compile-template-intent">{{ context.counter2}}</div>
5c3da6ad
`; } chars: string = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' getRandomChar() { return this.chars[Math.floor(Math.random() * (62 - 0)) + 0] }
46a5670d
randomRouterLinkPure() {
5c3da6ad
let counter = 0; let randomString = ''; while (counter < 10) { counter++; randomString += this.getRandomChar(); }
96844f33
this.dataRouterLink = `<a mat-button class="p3x-ng-compile-template-intent" href="javascript:void(0)" routerLink="${randomString}">${randomString}</a>`
46a5670d
} randomRouterLinkJit() { let counter = 0; let randomString2 = ''; while (counter < 10) { counter++; randomString2 += this.getRandomChar(); }
5c3da6ad
this.dataMaterial = `
96844f33
${this.dataMaterialDefault} <a mat-button class="p3x-ng-compile-template-intent" href="javascript:void(0)" routerLink="${randomString2}">${randomString2}</a>
5c3da6ad
` } ngOnInit() { this.update1(); this.update2();
46a5670d
this.randomRouterLinkPure() this.randomRouterLinkJit()
5c3da6ad
/* let is = false; let newData = '<span>123</span>'; let defaultData = ''; let count = 0; this.interval = setInterval(() => { is = !is; if (is) { count++; defaultData = defaultData + newData; this.data3 = defaultData + defaultData; if (count > 10) { count = 0; defaultData = newData; } } else { this.data3 = '<div>321</div>' } }, 1000) */ } ngOnDestroy() { clearInterval(this.interval); } }