ionic4

Ionic 4 native plugin not working

女生的网名这么多〃 提交于 2019-12-03 20:16:42
I am facing a problem with Ionic 4 native plugins. I have installed ionic 4 Cordova native plugin "Geolocation" but when I run the app into my iOS or Android device it's showing to me a blank white screen and nothing happening. app.module.ts code: import { Geolocation } from '@ionic-native/geolocation'; @NgModule({ declarations: [AppComponent], entryComponents: [], imports: [ BrowserModule, IonicModule.forRoot(), AppRoutingModule, ComponentsModule ], providers: [ StatusBar, SplashScreen, ** Geolocation ** , { provide: RouteReuseStrategy, useClass: IonicRouteStrategy } ], bootstrap:

How to toggle Menu in Ionic 4

帅比萌擦擦* 提交于 2019-12-03 13:11:17
I am new to Ionic, and I am developing a basic app in Ionic 4 with sidemenu . I am adding a button in Side Menu , when I am clicking on that button the menu is not toggling. can anyone help me in this ? here's the code which I am trying. <ion-button color="primary" (click)="function()" class="class" menuToggle expand="block" fill="outline"> text </ion-button> Explanation of not Duplicate question Please check the Bold text, I already have a working sidemenu, but the problem is I want to close the sidemenu when I click on ion-button , not on ion-item . Simply encapsulate your ion-button within

ionic 4: changing ion-content background does not work

懵懂的女人 提交于 2019-12-03 11:36:02
问题 i have tried in global.scss as ion-content{ background-image: url('assets/images/cover.jpg'); -webkit-background-image: url('assets/images/cover.jpg'); background-repeat: no-repeat; background-size:cover; } but this does not render the image. tried path as ./assets/images/cover.jpg as well. if i put the same image as img tag on the page that shows up ruling out invalid image possibility. I also tried to put in the homeage.scss as .myview { background-image: url('../../assets/images/cover.jpg'

Ionic 4 - Pass Data BACK from Modal

孤街浪徒 提交于 2019-12-03 11:25:12
I'm trying to create a modal window, pass it an array of objects, have a user select one object from that array, and then have my modal pass back the object they've selected. I've tried using the Ionic 2 approach of modalName.onDidDismiss(data=> …) as explained here , but apparently Ionic 4 changed "onDidDismiss" to not accept any values passed back to it. So I'm at a loss for how to send data from my Modal window back to the page that called it. Some days ago I had the same problem and here's my solution: I guess, you already have a component which contains the actual modal. name

ionic 4: changing ion-content background does not work

≡放荡痞女 提交于 2019-12-03 03:13:09
i have tried in global.scss as ion-content{ background-image: url('assets/images/cover.jpg'); -webkit-background-image: url('assets/images/cover.jpg'); background-repeat: no-repeat; background-size:cover; } but this does not render the image. tried path as ./assets/images/cover.jpg as well. if i put the same image as img tag on the page that shows up ruling out invalid image possibility. I also tried to put in the homeage.scss as .myview { background-image: url('../../assets/images/cover.jpg'); background-repeat: no-repeat; background-size:cover; } and using class="myview" in home.html no luck

How do I install new fonts in Ionic 4?

落爺英雄遲暮 提交于 2019-12-03 02:31:55
Does anyone know how to update the font for Ionic 4? I tried adding the aileron.woff to assets/fonts and putting this in the variables.scss to no avail. src: url('../assets/fonts/aileron.woff') format('woff'); Strider This is how I managed to add a custom font to my Ionic application Add a directory that contains the font files to the project under the folder src\assets\fonts src\assets\fonts\myCustomFont | +-- MyCustomFontBold.ttf +-- MyCustomFontBoldItalic.ttf +-- MyCustomFontItalic.ttf +-- MyCustomFontRegular.ttf Define the fonts in the file src\theme\variables.scss : @font-face { font

Navigate from Login page to Tabs in Ionic4?

帅比萌擦擦* 提交于 2019-12-02 23:19:20
问题 I am creating an application and i want move from login Page to Tabs Page. When I try to navigate to Tabs page, its only showing Home page without Tabs. here is my Code. app-routing.module.ts import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [ { path: '', redirectTo: 'login', pathMatch: 'full' }, { path: 'login', loadChildren: './pages/login/login.module#LoginPageModule' }, { path: 'tabs', loadChildren: './pages/tabs/tabs

I cant retrieve data from server when I use android studio virtual emulator

好久不见. 提交于 2019-12-02 23:01:54
问题 I have an app, that works fine on browser, but i run it on the emulator it cant retrieve data from the server I got this error : polyfills.js:5601 OPTIONS http://localhost:3005/api/posts/toto net::ERR_CONNECTION_REFUSED scheduleTask @ polyfills.js:5601 push../node_modules/zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ polyfills.js:2768 onScheduleTask @ polyfills.js:2659 capacitor-runtime.js:81 ERROR TypeError: You provided 'function (error) { // TODO: send the error to remote logging

Hosting a PWA in ionic with mysql database

…衆ロ難τιáo~ 提交于 2019-12-02 17:51:00
问题 I have a mobile application in ionic and have uploaded it in playstore. Now I want to host it in a website. How do i do that with ionic 4 and mysql? I have tried visiting the ionic documentation about PWA but they are using firebase. ng add @angular/pwa ionic build --prod --service-worker ionic build --prod 回答1: if you not need Cordova use: npm run ionic:build --prod and copy all from the www folder to your Web Server or if you need Cordova then Use Browser Platform for websites. ionic

Navigate from Login page to Tabs in Ionic4?

拜拜、爱过 提交于 2019-12-02 13:10:53
I am creating an application and i want move from login Page to Tabs Page. When I try to navigate to Tabs page, its only showing Home page without Tabs. here is my Code. app-routing.module.ts import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; const routes: Routes = [ { path: '', redirectTo: 'login', pathMatch: 'full' }, { path: 'login', loadChildren: './pages/login/login.module#LoginPageModule' }, { path: 'tabs', loadChildren: './pages/tabs/tabs.module#TabsPageModule' } ]; @NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule