Skip to content

Commit a4431e7

Browse files
authored
chore: add angular usage example to qr readme (#119)
1 parent d097d43 commit a4431e7

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

packages/nativescript-qr/README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,28 @@ npm install @nstudio/nativescript-qr
66

77
## Usage
88

9-
// TODO
9+
### Angular
10+
11+
Component / Module:
12+
```typescript
13+
import { Image } from "@nativescript/core";
14+
import { Qr } from "@nstudio/nativescript-qr";
15+
export class YourComponent{
16+
...
17+
onImageLoaded(args) {
18+
const image = args.object as Image;
19+
const result = Qr.generate('Hello World');
20+
image.imageSource = result;
21+
}
22+
...
23+
}
24+
```
25+
26+
View:
27+
28+
```html
29+
<Image src="" (loaded)="onImageLoaded($event)"></Image>
30+
```
1031

1132
## License
1233

0 commit comments

Comments
 (0)