Skip to content

Commit

Permalink
fix(angular-getting-started) fixed some type errors on Taking Photos …
Browse files Browse the repository at this point in the history
…and Loading Photos pages
  • Loading branch information
Gregadeaux committed Jan 5, 2023
1 parent d147060 commit 9abba3d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/angular/your-first-app/2-taking-photos.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Outside of the `PhotoService` class definition (the very bottom of the file), cr
```tsx
export interface UserPhoto {
filepath: string;
webviewPath: string;
webviewPath?: string;
}
```

Expand Down
4 changes: 2 additions & 2 deletions docs/angular/your-first-app/4-loading-photos.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ With the photo array data saved, create a function called `loadSaved()` that can
```tsx
public async loadSaved() {
// Retrieve cached photo array data
const photoList = await Preferences.get({ key: this.PHOTO_STORAGE });
this.photos = JSON.parse(photoList.value) || [];
const { value } = await Preferences.get({ key: this.PHOTO_STORAGE });
this.photos = (value ? JSON.parse(value) : []);

// more to come...
}
Expand Down
4 changes: 2 additions & 2 deletions docs/angular/your-first-app/5-adding-mobile.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Next, head back over to the `loadSaved()` function we implemented for the web ea
```tsx
public async loadSaved() {
// Retrieve cached photo array data
const photoList = await Preferences.get({ key: this.PHOTO_STORAGE });
this.photos = JSON.parse(photoList.value) || [];
const { value } = await Preferences.get({ key: this.PHOTO_STORAGE });
this.photos = (value ? JSON.parse(value) : []);

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

0 comments on commit 9abba3d

Please sign in to comment.