Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48983

Build Your First App error

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 48983

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>