Skip to content

Commit e7a7132

Browse files
feat: add Stencil example
1 parent b59149f commit e7a7132

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

projects/elements-demo/src/app/features/examples/basic/basic.component.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,37 @@ <h2>Advanced binding (objects instead of primitives)</h2>
143143
<pre [highlight]="codeExample4"></pre>
144144
</div>
145145
</div>
146+
147+
<div class="content">
148+
<div class="implementation" *ngIf="!example5">
149+
<button mat-flat-button color="accent" (click)="example5 = true">
150+
<mat-icon>play_arrow</mat-icon>
151+
Run
152+
</button>
153+
</div>
154+
<div class="implementation" *ngIf="example5">
155+
<ng-template #loading>Loading...</ng-template>
156+
<ng-template #error>Loading failed...</ng-template>
157+
<deckgo-qrcode
158+
*axLazyElement="
159+
'https://unpkg.com/@deckdeckgo/qrcode@1.0.0-alpha.9/dist/deckdeckgo-qrcode/deckdeckgo-qrcode.js';
160+
loadingTemplate: loading;
161+
errorTemplate: error
162+
"
163+
content="https://angular-extensions.github.io/elements"
164+
style="--deckgo-qrcode-size: 200px;"
165+
>
166+
</deckgo-qrcode>
167+
</div>
168+
<div class="description">
169+
<p>
170+
Cool things about the above Ionic example? Ionic is build with Stencil
171+
and therefore, each Web Components developed and bundled with that
172+
compiler, could also be load the exact same way as for example for the
173+
following <code>&#60;deckgo-qrcode></code> component from the project
174+
DeckDeckGo which generates and displays a QR-Code.
175+
</p>
176+
<pre [highlight]="codeExample5"></pre>
177+
</div>
178+
</div>
146179
</div>

projects/elements-demo/src/app/features/examples/basic/basic.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export class BasicComponent implements OnInit {
1111
example2 = false;
1212
example3 = false;
1313
example4 = false;
14+
example5 = false;
1415

1516
// example state
1617
counter = 0;
@@ -21,6 +22,7 @@ export class BasicComponent implements OnInit {
2122
codeExample2 = CODE_EXAMPLE_2;
2223
codeExample3 = CODE_EXAMPLE_3;
2324
codeExample4 = CODE_EXAMPLE_4;
25+
codeExample5 = CODE_EXAMPLE_5;
2426

2527
constructor() {}
2628

@@ -60,3 +62,7 @@ const CODE_EXAMPLE_4 = `<!-- url = 'https://unpkg.com/@ionic/core@4.6.2/dist/ion
6062
>
6163
</ion-datetime>
6264
</ion-item>`;
65+
66+
const CODE_EXAMPLE_5 = `<!-- url = 'https://unpkg.com/@deckdeckgo/qrcode@1.0.0-alpha.9/dist/deckdeckgo-qrcode/deckdeckgo-qrcode.js' -->;
67+
<deckgo-qrcode *axLazyElement="url" content="https://angular-extensions.github.io/elements" style="--deckgo-qrcode-size: 300px;">
68+
</deckgo-qrcode>`;

0 commit comments

Comments
 (0)