Commit 922bced7 authored by Priyanka Upadhye's avatar Priyanka Upadhye
Browse files

Merge branch 'master' into 4-reserve-a-bike

parents df0f482f f4c4ba3e
......@@ -15,6 +15,7 @@ import { IonicStorageModule } from '@ionic/storage';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { RestService } from './rest.service';
import { ToastService } from './services/toast.service';
@NgModule({
declarations: [AppComponent],
......@@ -31,6 +32,7 @@ import { RestService } from './rest.service';
StatusBar,
SplashScreen,
RestService,
ToastService,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
],
bootstrap: [AppComponent]
......
import { TestBed } from '@angular/core/testing';
import { ToastService } from './toast.service';
describe('ToastService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: ToastService = TestBed.get(ToastService);
expect(service).toBeTruthy();
});
});
import { Injectable } from '@angular/core';
import { ToastController } from '@ionic/angular';
@Injectable({
providedIn: 'root'
})
export class ToastService {
toast: any;
constructor(public toastController: ToastController) { }
showToast(message) {
this.toast = this.toastController.create({
message: message,
duration: 2000
}).then((toastData)=>{
toastData.present();
});
}
HideToast(){
this.toast = this.toastController.dismiss();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment