That’s currently by design - we’re leaving some steps as manual ones. Read more about why here.
In the meantime, check out this guide on how to generate and set them.
That’s currently by design - we’re leaving some steps as manual ones. Read more about why here.
In the meantime, check out this guide on how to generate and set them.
No I didnt, trying to do with Background mode. There is a module called background fetch ( which supports only IOS) will try that too.
Thanks for your feedback. I already looked at the lifecycle events and the routing and I understand that the framework works like this.
So then what would make you happy here?
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
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>
hi,
did you find a solution for this?
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.
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
Plugins’ installation instructions no longer shown in Ionic Native docs.
Anybody every figure this out? I am having the same problem. Http requests are kinda a big feature to be lacking…
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.
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.
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 Promise
s and Observable
s 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”.
Do you have an example…
Regarding your first reply, would you have a simple code snippet of the provider and the client component to illustrate this mechanic?
Yes, here’s one example out of the 250+ Ionic Native Community plugins:
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 !!!.
" <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’);
}
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?