ionic4

ionic 4 google-maps 5 beta “TypeError: Cannot read property 'BaseClass' of null”

谁说胖子不能爱 提交于 2019-12-06 00:42:05
问题 im trying to use ionic 4 google-maps@5.0.0-beta.20 i am following these slides: https://docs.google.com/presentation/d/1zlkmoSY4AzDJc_P4IqWLnzct41IqHyzGkLeyhlAxMDE/edit#slide=id.g282d0a7bfd_0_140 I get this error: "TypeError: Cannot read property 'BaseClass' of null" newlocation.page.html: <ion-content> <h3>Ionic GoogleMaps Starter</h3> <div id="map_canvas"> </div> </ion-content> newlocation.page.scss: map_canvas { height: 90%; } newlocation.page.ts: import { Component, OnInit } from '

How to use autocomplete on search bar on Ionic 4?

末鹿安然 提交于 2019-12-05 22:09:03
I'm looking for some example but cannot see anyone googling it, just what i want is to hardcode 2 or 3 words, thank you so much. Do i have to look for on ionic 3? or in angular2 better? In you html <ion-searchbar type="text" debounce="500" (ionInput)="getItems($event)"></ion-searchbar> <ion-list *ngIf="isItemAvailable"> <ion-item *ngFor="let item of items"> {{ item }} </ion-item> </ion-list> in you ts file this.isItemAvailable = false; // initialize the items with false initializeItems(){ this.items = ["Ram","gopi", "dravid"]; } getItems(ev: any) { // Reset items back to all of the items this

Ionic 4 (Angular 7) - sharing components issue

会有一股神秘感。 提交于 2019-12-05 16:27:08
I'm trying to do an extremely usual thing for such a framework like Angular. The goal is to use the same ( HeaderComponent ) component more than once through a shared module. My shared.module.ts: import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { HeaderComponent } from '../header/header.component'; import { IonicModule} from '@ionic/angular'; @NgModule({ imports: [ CommonModule, IonicModule ], declarations: [ HeaderComponent ], exports: [ HeaderComponent ] }) export class SharedModule {} In app.module.ts I added this: imports: [BrowserModule,

Ionic 4: Hardware Back Button Reloading Application

主宰稳场 提交于 2019-12-05 07:42:48
Working on a Project and stuck in an Issue: Hardware Back Button Reloading Application (I am using Angular Router in this application). My Code to Exit Application: ionViewDidEnter(){ this.subscription = this.platform.backButton.subscribe(()=>{ navigator['app'].exitApp(); }); } ionViewWillLeave(){ this.subscription.unsubscribe(); } While same logic Working in other applications. but in this application its reloading the application not exiting it. P.S: i have also tried it to put in platform.ready() but no luck. With IONIC 4 , there is new method subscribeWithPriority developed to handle race

Passing Data between pages from url

梦想的初衷 提交于 2019-12-05 07:35:15
I am working on ionic 4 project. My project is getting data json from url using input search . l want passing data when users is click on any items to show them another page for more details . l tried with this code but l get undefined value ! this code is holding search operation export class FlightsearchPage { public search = '' public flight : any filterItems:any; callsign : any; constructor(private http: HTTP, public loadingController: LoadingController, private nav : NavController) { this.addThemFunction } keyPressed(event: any) { / console.log(event.target.value); this.addThemFunction

How to remove small caret from ion-select in ionic4

心已入冬 提交于 2019-12-05 07:03:42
I want to remove the inbuilt grey small caret from ion-select , and use my custom caret(arrow) instead. Code: ion-select { color: grey; background:url("/assets/resources/img/ArrowDownConfig.svg") no-repeat 92% center !important; } But my css code is unable to precedence over the ionic(inbuilt). You can see there are two arrows in the image, one is inbuilt and another is custom. I want to remove inbuilt(ionic) one. I don't know how to fix, faced same problem, but it seems to be issue with DOM Shadow If you will find anything, let to know as well please, thanks. Update: Found some answer UPDATE

How to toggle Menu in Ionic 4

大兔子大兔子 提交于 2019-12-04 19:30:56
问题 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

HTML2Canvas generating blank image in Ionic4 angular proj. No error in console. Same code generates proper image in plain html/javascript

♀尐吖头ヾ 提交于 2019-12-04 18:07:41
I have html2canvas installed and imported in home.page.ts in my Ionic4 angular test project. I have a plain 100px X 100px, yellow background div with a single line of text. I am passing this div to html2canvas to be downloaded as png. html2canvas is listing all steps (no errors) in the console and generating the png with the same size as the given div but the div is empty.It does not have the color of the div or the text. Changing the size of the div takes effect properly meaning the generated image has the same size as the div. This test project demonstrate the issue - https://stackblitz.com

ionic 4 adding side menu

六眼飞鱼酱① 提交于 2019-12-04 00:00:29
问题 i started a project with tab template which i then later decided to add a side menu. the trouble is the side menu does not appear at all. here is my app.components.html looks like <ion-app> <ion-split-pane> <ion-menu side="start"> <ion-header translucent> <ion-toolbar color="secondary"> <ion-title>Menu</ion-title> </ion-toolbar> </ion-header> <ion-content><ion-list><ion-item>he vik</ion-item></ion-list></ion-content> </ion-menu> <ion-router-outlet></ion-router-outlet> </ion-split-pane> </ion

Ionic 4 custom components

﹥>﹥吖頭↗ 提交于 2019-12-03 22:06:56
How do you load a component in ionic 4 after running the command ionic g component myComponent ? I want to add a new generated custom component to my home page. Finally figured this out, here's a repro that works: ionic start myProject blank --type=angular ionic g module components ionic g component components/myComponent --export This adds both a declaration and export to the components module for "myComponent". To use the component just add ComponentsModule to your imports in your page module, e.g. @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, ComponentsModule, RouterModule