Skip to content

Commit 89e7bf5

Browse files
Merge branch 'shashi089:main' into vue-demo
2 parents ba1a715 + 133cd18 commit 89e7bf5

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Explore the capabilities of `qrlayout-core` & `qrlayout-ui` through our framewor
1414
| Framework | Live Demo | Source Code |
1515
| :--- | :--- | :--- |
1616
| **React** | [Live Demo](https://qr-layout-designer.netlify.app/) | [Source](https://github.com/shashi089/qr-code-layout-generate-tool/tree/main/examples/react-demo) |
17+
| **Angular** | [Live Demo](https://qr-layout-designer-angular.netlify.app/) | [Source](https://github.com/shashi089/qr-code-layout-generate-tool/tree/main/examples/angular-demo) |
1718
| **Svelte 5** | [Live Demo](https://qr-layout-designer-svelte.netlify.app/) | [Source](https://github.com/shashi089/qr-code-layout-generate-tool/tree/main/examples/svelte-demo) |
1819
| **Vue 3** | [Live Demo](https://qr-layout-designer-vue.netlify.app/) | [Source](https://github.com/shashi089/qr-code-layout-generate-tool/tree/main/examples/vue-demo) |
1920

packages/ui/README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ A framework-agnostic, embeddable UI for designing sticker layouts with QR codes.
77
| Framework | Live Demo | Source Code |
88
| :--- | :--- | :--- |
99
| **React** | [Live Demo](https://qr-layout-designer.netlify.app/) | [Source](https://github.com/shashi089/qr-code-layout-generate-tool/tree/main/examples/react-demo) |
10+
| **Angular** | [Live Demo](https://qr-layout-designer-angular.netlify.app/) | [Source](https://github.com/shashi089/qr-code-layout-generate-tool/tree/main/examples/angular-demo) |
1011
| **Svelte 5** | [Live Demo](https://qr-layout-designer-svelte.netlify.app/) | [Source](https://github.com/shashi089/qr-code-layout-generate-tool/tree/main/examples/svelte-demo) |
1112
| **Vue 3** | [Live Demo](https://qr-layout-designer-vue.netlify.app/) | [Source](https://github.com/shashi089/qr-code-layout-generate-tool/tree/main/examples/vue-demo) |
1213

@@ -202,10 +203,10 @@ onUnmounted(() => {
202203
<div bind:this={container} style="width: 100%; height: 800px;"></div>
203204
```
204205

205-
### 4. Angular (v14+)
206+
### 4. Angular (v17+ Standalone)
206207

207208
```typescript
208-
import { Component, ElementRef, ViewChild, AfterViewInit, OnDestroy } from '@angular/core';
209+
import { Component, ElementRef, ViewChild, OnInit, OnDestroy } from '@angular/core';
209210
import { QRLayoutDesigner } from 'qrlayout-ui';
210211
import 'qrlayout-ui/style.css';
211212

@@ -214,15 +215,17 @@ import 'qrlayout-ui/style.css';
214215
selector: 'app-qr-designer',
215216
template: '<div #container style="width: 100%; height: 800px;"></div>'
216217
})
217-
export class QrDesignerComponent implements AfterViewInit, OnDestroy {
218-
@ViewChild('container') container!: ElementRef;
218+
export class QrDesignerComponent implements OnInit, OnDestroy {
219+
@ViewChild('container', { static: true }) container!: ElementRef;
219220
private designer?: QRLayoutDesigner;
220221

221-
ngAfterViewInit() {
222-
this.designer = new QRLayoutDesigner({
223-
element: this.container.nativeElement,
224-
onSave: (data) => console.log('Saved Layout:', data)
225-
});
222+
ngOnInit() {
223+
if (this.container?.nativeElement) {
224+
this.designer = new QRLayoutDesigner({
225+
element: this.container.nativeElement,
226+
onSave: (data) => console.log('Saved Layout:', data)
227+
});
228+
}
226229
}
227230

228231
ngOnDestroy() {

0 commit comments

Comments
 (0)