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

Ratings component


writeFile new line

$
0
0
this.file.writeFile(this.file.externalRootDirectory, 'mydir.txt',this.dateForDisplay+"\n",{ replace: false, append: true });

Ionchange event not firing when boolean changed from false to true

$
0
0

Hello Raul, I created a plunker that hopefully helps show the problem more clearly. The first time you toggle the top button, only one change event fires. But subsequent toggles will fire two change events. You can find the plunker here and thank you for your interest in helping our: http://plnkr.co/edit/r3WsxzWDR0ssko4shkda?p=info

Change meta tags in PWA

$
0
0

I have a progressive web app that has a page that displays images. Currently, when a user shares a URL to an image (/image/123) on Twitter or Facebook there is no image preview because the page is lacking the appropriate meta tags and the scrapers for both Twitter and Facebook do not execute any scripts. My understanding is that any attempt to dynamically update these tags will not work.

What is the best way to manage meta tags dynamically in a progressive web app?

How to view the json data in HTML page

Ionic 2 delete images from php server

$
0
0

hii,
how to delete selected uploaded images from php server

I have x tasks to execute. How to execute y in parallel until all are finished?

$
0
0

I have to make lots of HTTP requests for data to an API. I have a service with functions that give me the expected results via promises. My initial thought was to put the requests information in an array, then loop over it and call my service function to get the data, which then writes the data in another array (array2). After the long time the loop will take to get all the data I then write that array2 into storage for further usage.

Those of you that already got all the async stuff will (rightfully) laugh now, as of course this doesn't work at all: As the promises are aync, the loop is finished in a few miliseconds and an empty array is written to storage. Meanwhile my browser (and debug API server!) almost crashes because of the thousands of HTTP requests I just sent out at the exact same moment. Yeah, async is hard for some of us :blush:

After I realized my mistake I thought about the problem a bit more and realized, that I need to limit the number of calls that are done at the same time. Probably my API service could handle that internally and start a waiting list of calls to it and only x requests are then fire in parallel.

But that of course won't help with the problem that the loop still finishes instantly and I write my empty array to storag. So I thought that there has to be a way to check if a list of promises is finished. It does, it is called promises.all and "resolves when all of the promises have resolved". Perfect: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise/all ... not: "It rejects with the reason of the first promise that rejects." :frowning: So this will reject if one request goes wrong. This is not what I want. Also no way to limit the parallelization - promise.all still will DDOS my server and kill the browser.

More googling brought me to async.mapLimit: https://caolan.github.io/async/docs.html#mapLimit Parallel execution, limited to y, collects all the responses, perfect.

But is this the way I want to go? Googling for mor information I of course ended up in the pit of 2015/16 nodejs posts about the different implementations (bluebird?) of everything and ... UAH! I have no idea if this will even work and is not a monumental mistake.

So my question (finally):
I have x tasks to execute. What should I use to execute y of them in parallel until they are all finished (some not working should be handled by just continuing, not stopping all work)?

Ionic tabs to menu

$
0
0

thank you Sujan12 for your comment i wanted to change my ionic tabs to ionic menu
but i solved my problem with ionic creater tool
thank you again


I have x tasks to execute. How to execute y in parallel until all are finished?

$
0
0

(While closing tabs of my research I found https://github.com/timdp/es6-promise-pool. This looks more fitting to the browser and also uses understandable words to describe what it does. But only ~100 Github stars. Is this what I am looking for?)

Slider zoom is not working in v2 final

$
0
0

Thanks for posting a solution. I can confirm that this solution works, but seems buggy. I am testing on IOS 10.
I'm noticing the following issues:
1. If you zoom an image and then pan to the next image, the next slide image overlays the zoomed image
2. At other times, if you zoom and image, it goes back to un-zoom the moment you release the pinch

1 & 2 randomly happen - there doesn't seem to be a definitive pattern.

Have you experienced this issue?

Ionic delete images from php server

$
0
0

You have to tell us a bit more.

What does that mean?
Where do you select? How do you select?
When and how where these images uploaded?

Best tell us a little story of the steps the user takes from the beginning to the end.

(click) handler on dynamic text

$
0
0

If somebody could point me in the right direction, it would be hugely appreciated - I'm just not sure what to search for (term, concept, component, etc). And if code snippets, etc., help please let me know.

I'm building in Ionic 3, targeting iOS and Android.

I have a comment list populating from my server via json and would like to embed "links" in those comments that navigate to a separate view with navParams when clicked. For example, there may be hashtags and/or @ mentions in the comment as below:

Hey @homer check out #simpsons for related information.

I've got the regex to parse these out and format them, but I can't figure out how to assign an event handler for a click dynamically.

Here's the function/method that I'm working on, that inserts HTML into the comment. I'm totally fine with doing it another way.

  formatComment(data) {
    data = data.replace(/#(\S*)/g,'<a href="" (click)="console.log(\'Click Event Fired\')">#$1</a>');
    return this._sanitizer.bypassSecurityTrustHtml(data);
  }

Again, thanks so much in advance.

Best way to implement list with toggles and sending it back to server

$
0
0

@rapropos - that is a great solution! Thanks a lot!

How dumb of me not to come up with something similar. Maybe because I was thinking there has to be some cleaner and Ionic specific way. :slight_smile: This is not to say your way is not cleaner, it's just more work, so to say.

Apparently, after reading through forums and tutorial websites and documentation, Ionic doesn't have a pop() method, like push(), in which we can pass objects/values. And nothing in the plans too, it looks like.

From a best practices perspective, what do you think of this solution?

Your input will be greatly appreciated.

Thanks again!

Keystore file does not exist

$
0
0

I am also experiencing this issue. Were you able to resolve this?

Slider zoom is not working in v2 final

$
0
0

I've never gotten it to work, unfortunately. (Ionic 3.5.0 on iOS 10.3 WKWebView)


(click) handler on dynamic text

How to increase width of ion-tab in ion-tabs?

$
0
0

Hi, I have same issue. Did you find a solution yet?

How to change the width of ion-tab

$
0
0

Hi, can anyone tell me know to adjust the width of a ion-tab. Currently all the ion-tab are of equal width but I want one of them (the left most one) to be wider than others. How can I achieve this?

virtualScroll with cards? approxItemHeight?

$
0
0

It's possible to do the virtualScroll with cards? And how to properly set the approxItemHeight, because the docs don't give an example.

How to lazy load images?

$
0
0

There are two costs to manage: cost of calling the backend, and cost of calling the DOM. Our solution for a similar problem was to download a lot of thumbnails (and metadata) from the backend, and to display those thumbnails with virtualScroll or something similar. Then, if the user focuses on a particular thumbnail, the software downloads the large file from the backend. This way, the average query to the backend is inexpensive, and the DOM only renders the thumbnails it needs to.

Viewing all 228529 articles
Browse latest View live


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