Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228595 articles
Browse latest View live

Ionic 4 capacitor did not copy icon and splash resources


Ionic 3 cordova Contacts plugin lazy loading

$
0
0

No I didnt, trying to do with Background mode. There is a module called background fetch ( which supports only IOS) will try that too.

Ionic 4 avoid pages being destroyed

$
0
0

Thanks for your feedback. I already looked at the lifecycle events and the routing and I understand that the framework works like this.

Ionic 4 avoid pages being destroyed

$
0
0

So then what would make you happy here?

Ionic 4 avoid pages being destroyed

$
0
0

On the home page I display a product listing, which also contains images. If a user clicks on one of the

<ion-card class="ion-lister" button (click)="openDetailsWithService(ID)">

element, he will be directed to the detail page and will get more information and another product listing will be loaded. If I now navigate back with

<ion-back-button [routerLink]="'/home'" routerDirection="back"></ion-back-button>

the page will be removed. If I click on the same element again, all images are reloaded.

And it’s that kind of behavior that’s giving me a headache.

How can I ensure that images are not loaded over the network again but from the WebView cache

Gestures with Angular bindings

$
0
0

I’ve got a page with a simple swipe gesture. On the swipe end event I increment a counter. There is a binding on the html of the page, which doesn’t get updated. Console.log() shows the updated counter, though. Is there a known issue about that or am I doing something wrong?

export class TestPage {

  counter = 0;

  swipeGesture: Gesture;
  @ViewChild('contentElement', { static: true, read: ElementRef }) contentElement: ElementRef;

  constructor(private gestureController: GestureController) { }

  ionViewDidEnter() {
    this.swipeGesture = this.gestureController.create({
      el: this.contentElement.nativeElement,
      gestureName: 'swipe',
      onEnd: () => this.onSwipeEnd(),
    });
    this.swipeGesture.enable();
  }

  private onSwipeEnd() {
    this.counter++;
    console.log(this.counter);
  }

}
<ion-content #contentElement>
    {{ counter }}
</ion-content>

Dectect rectangle and crop image by OpenCV.js

$
0
0

hi,
did you find a solution for this?

Ionic 4 avoid pages being destroyed

$
0
0

Are you certain this is the problem? I just tried this:


interface Fruit {
  name: string;
  pic: string;
}

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {
  fruits: Fruit[] = [
    {name: "apple", pic: "https://images-na.ssl-images-amazon.com/images/I/319J7YpfyNL.jpg"},
    {name: "banana", pic: "https://cdn.mos.cms.futurecdn.net/42E9as7NaTaAi4A6JcuFwG-970-80.jpg"},
    {name: "cherry", pic: "https://www.boeschbodenspies.com/wp-content/uploads/2017/08/cherry.png"}
  ];
  selfruit?: Fruit;
}
<ion-content>
    <ion-item>
        <ion-select [(ngModel)]="selfruit">
            <ion-select-option *ngFor="let fruit of fruits" [value]="fruit">{{fruit.name}}</ion-select-option>
        </ion-select>
    </ion-item>

    <div *ngIf="selfruit">
        <img [src]="selfruit.pic">
    </div>
</ion-content>

The first time I cycle through the various fruits, the images are loaded from the network. Thereafter, no matter how many times I choose each, Chrome Developer Tools’ Network tab says that it is loading the images from the disk cache, and does not hit the network at all.


Ionic 4 avoid pages being destroyed

$
0
0

Are you certain this is the problem? I just tried this:

No, you’re right. Restarting Chrome and recompiling the project fixed the problem. Thanks

Installation instructions for plugins gone after Ionic 5

$
0
0

Plugins’ installation instructions no longer shown in Ionic Native docs.

Fetch problem Ionic 4

$
0
0

Anybody every figure this out? I am having the same problem. Http requests are kinda a big feature to be lacking…

Camera preview getZoom returns [object Promise]

$
0
0

Hi @rapropos , sorry still having difficulties to understand here. My intention was just getting the zoom number from the camera preview. When I run the code CameraPreview.getZoom(), it supposed to return an integer number of the current zoom right? Because I also tried the CameraPreview.setZoom(5), it works fine my camera can zoom. I tried it with the alert("zoom = " + CameraPreview.getZoom()) and it shows me the alert with this message “zoom = [object Promise]”. I was hoping for “zoom = 5”. Please correct me if I have a wrong understanding. Thanks.

Job interview

$
0
0

Hello @gina!
Welcome to the community!
I am not sure, if the Forum is for this. But let’s go…
Don’t be afraid. I suggest you to talk about the projects that you worked on. What you have learned on those projects and the features you have developed on it. Talk about the challenges do you overcame and how you did to succeed. Tell about the most important project do you have participated and what was you collaboration to it. Show how do you face the problems and solve them, which solutions do you implemented for each one. So relax! Act natural, focus and speak slowly.
I hope it helps you to get this opportunity.

Camera preview getZoom returns [object Promise]

$
0
0

No, it returns a Promise that will eventually resolve with that.

That’s never going to happen. If you would like to go down a rabbit hole, there are at least 100 posts by me alone on these forums covering this general topic, so you can take some solace in the fact that you are by no means alone.

CameraPreview.getZoom().then(zoom => {
  // only in here can you do this
  console.log(zoom);
});
// nope, not here
console.log(zoom);

JavaScript has only a single thread of execution, so I think it’s a terrible language to be writing web applications in, but nobody asked me. In order to get around this limitation, futures such as Promises and Observables were invented. Then somebody thought to add even more syntactical sugar that IMHO makes things even more confusing with async and await.

The bottom line is that imperative programming style, like this:

let zoom = CameraPreview.getZoom();
doSomethingWith(zoom);

…is going to cause you no end of misery when writing web applications. Life will get much better when you think functionally:

CameraPreview.getZoom().then(zoom => doSomethingWith(zoom));
merrilyGoAboutOtherBusiness();

You don’t know when getZoom will actually return, and you have to train yourself not to care. All you can do is to say “when it does return, here is what I want to do with the result”.

Installation instructions for plugins gone after Ionic 5


Making component to wait until async operations in the provider constructor gets resolved

$
0
0

Regarding your first reply, would you have a simple code snippet of the provider and the client component to illustrate this mechanic?

Installation instructions for plugins gone after Ionic 5

Camera preview getZoom returns [object Promise]

$
0
0

Hi @rapropos, thank you so much for your help. Using “then” really works with the callback function.

About the async and await I couldn’t agree more with you. It makes my life miserable until now. And again thank you so much for your help !!!.

How to trigger a function when the ion-menu-button is closed in ionic

$
0
0

" <ion-menu [content]=“content” (ionOpen)=“menuOpened()” (ionClose)=“menuClosed()” >"

Its working just i have run on my ionic 3 framework.

app.html
<ion-menu [content]=“content” (ionOpen)=“sidemenuopen()” (ionClose)=“sidemenuclose()” >

app.componant.ts

sidemenuopen()
{
console.log(‘Side menu open’);
}

sidemenuclose()
{
console.log(‘Side menu close’);
}

Installation instructions for plugins gone after Ionic 5

$
0
0

Ah, yes, I see I had wandered into the Premium plugins section.

Instructions are frequently found with the plugin…

…has this not always been the case?

Viewing all 228595 articles
Browse latest View live


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