Skip to content

Commit 9abba3d

Browse files
committed
fix(angular-getting-started) fixed some type errors on Taking Photos and Loading Photos pages
1 parent d147060 commit 9abba3d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/angular/your-first-app/2-taking-photos.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Outside of the `PhotoService` class definition (the very bottom of the file), cr
8383
```tsx
8484
export interface UserPhoto {
8585
filepath: string;
86-
webviewPath: string;
86+
webviewPath?: string;
8787
}
8888
```
8989

docs/angular/your-first-app/4-loading-photos.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ With the photo array data saved, create a function called `loadSaved()` that can
3535
```tsx
3636
public async loadSaved() {
3737
// Retrieve cached photo array data
38-
const photoList = await Preferences.get({ key: this.PHOTO_STORAGE });
39-
this.photos = JSON.parse(photoList.value) || [];
38+
const { value } = await Preferences.get({ key: this.PHOTO_STORAGE });
39+
this.photos = (value ? JSON.parse(value) : []);
4040

4141
// more to come...
4242
}

docs/angular/your-first-app/5-adding-mobile.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ Next, head back over to the `loadSaved()` function we implemented for the web ea
9393
```tsx
9494
public async loadSaved() {
9595
// Retrieve cached photo array data
96-
const photoList = await Preferences.get({ key: this.PHOTO_STORAGE });
97-
this.photos = JSON.parse(photoList.value) || [];
96+
const { value } = await Preferences.get({ key: this.PHOTO_STORAGE });
97+
this.photos = (value ? JSON.parse(value) : []);
9898

9999
// Easiest way to detect when running on the web:
100100
// “when the platform is NOT hybrid, do this”

0 commit comments

Comments
 (0)