Hi everyone,
I’m new to ionic and am trying to build the photo-gallery sample app for Angular aka Build Your First App. When I copy the instructed piece of code into the tab2.page.ts file, the app shows this following error.
Failed to compile.
src/app/services/photo.service.ts:1:1 - error TS1128: Declaration or statement expected.
1 public async addNewToGallery() {
My tab2.page.ts file looks as following :
import { Component } from '@angular/core';
@Component({
selector: 'app-tab2',
templateUrl: 'tab2.page.html',
styleUrls: ['tab2.page.scss']
})
export class Tab2Page {
constructor() {}
}
import { PhotoService } from '../services/photo.service';
constructor(public photoService: PhotoService) { }
addPhotoToGallery() {
this.photoService.addNewToGallery();
}
Any help would be appreciated, Thank you.
1 post - 1 participant