Troubleshooting the Speed of Ionic Scrolling

One of the features in my application involves displaying feeds or a timeline. Below is the ng-repeat code I am using:

<div ng-repeat="x in feeds" class="fd-feed-card">
    <div class="fd-feed-usr-img">
        <img ng-src="{{x.user.media[0].small}}" class="fd-img fd-img-br border-style">
    </div>

    <div class="ft-16 fd-feed-usr-name">
        <span><b>{{x.user.name}}</b></span><span class="ft-12 fd-feed-created-time plx prm">{{x.feed.createdTimeStamp | readableTime}}</span>
    </div>
    <div ng-style="imgStyle">
        <img ng-src="{{x.feed.media[0].medium}}" class="fd-img objectcover image-blur">
    </div>
    <div ng-if="x.feed.total_comments > 0 || x.feed.total_likes >0">
        <p class="mll"><span on-tap="openCommentModal(x.feed._id, $index, x.feed)" class="prm" ng-if="x.feed.total_comments > 0">{{x.feed.total_comments}} Comment</span><span ng-if="x.feed.total_likes>0" on-tap="openUserModal(x.feed._id)">{{x.feed.total_likes}} Likes</span>
        </p>
    </div>
    <div class="fd-feed-distance">
        <span class="plx prm ft-16">{{x.distance}} <span class="ft-10">mil</span></span>
    </div>
</div>

In addition to this, each feed includes a username, user image, a 400*400px feed image, and distance. To implement infinite scrolling with Ionic, I use the following code:

<ion-infinite-scroll on-infinite="getDashboardFeed()" distance="1%" ng-if="!noMoreFeedContent"></ion-infinite-scroll>

Within my JavaScript code, I make API calls with pagination fetching 5 feeds at a time. Here is the relevant JavaScript snippet:

$scope.getDashboardFeed = function(start) {
    var _start = start || false;
    var params = {}
    params.offset = offset;
    params.limit = limit;
    Posts.getAllFeeds(params).success(function(res) {
            // Code logic for fetching, processing, and displaying feeds
        })
        .error(function(err) {

        })
};

I also calculate distances between feeds based on current location and check if I have liked a post. However, when the number of loaded feeds reaches around 25-30, the scroll performance becomes laggy on Android devices. Despite trying native scrolling and collection-repeat feature, I haven't been able to resolve this issue.

Seeking advice, I have explored resources such as this link and this article, but without much success. With the need to handle thousands of feeds, each containing a large image, I am looking for alternative approaches to improve scroll performance. Any suggestions or insights would be greatly appreciated.

Answer №1

I encountered a similar problem, especially when incorporating images in ng-repeat.

Feel free to read my solution here

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Disappearance of icon upon hovering in CSS

I am currently working with Angular JS (1.x) and I have a requirement to display tooltip text when hovering over an info icon. The tooltip text appears properly, but the issue is that the icon disappears when hovered over. It reappears once the hover is re ...

Utilizing the .each() Method in Your jQuery Plugin

I have been working on developing a custom navigation feature that shares similarities with the hoverable sidenav button menu demonstrated on w3schools (https://www.w3schools.com/howto/howto_css_sidenav_buttons.asp). My goal is to transform this into a j ...

The problem lies in the execution of the $.getJSON function - the data is successfully converted from JSON to

My current task involves retrieving data from a json file hosted on a server, storing it in a global array, and then utilizing it in vue to iterate through the list. However, I am encountering an issue where even though the array is populated when printed ...

The Firefox dropdown menu constantly reverts back to the default option because of JavaScript running in AngularJS

I am currently developing an AngularJS app and encountering issues with select dropdown menus specifically in Firefox. Whenever I click on a select menu and hover over the options, it automatically resets the selected option back to the default/first opti ...

Unit testing AngularJS service with promise

Could use some assistance with unit testing a service that relies on a repository returning a promise to the consumer. Struggling to figure out how to properly test the promise. Any guidance would be welcomed! ...

Tips for developing a web-based whiteboard application

I am tasked with developing a web application that allows users to design factory layouts by dragging and dropping pre-built components like robots, manufacturing cells, and conveyors onto a canvas. The goal is to create something similar to websites such ...

Submitting a form and obtaining results without relying on jQuery

Finding information on how to accomplish this task without using jQuery has proven to be a challenge. It seems like everyone is pushing for jQuery for even the simplest tasks nowadays. Despite avoiding unnecessary use of jQuery in creating a rich experienc ...

Incorporate a JavaScript file into an HTML document

I am encountering a significant issue with incorporating JavaScript files into HTML files. Here is my HTML snippet: <!DOCTYPE html> <html> <head> <title>Express App</title> </head> <body> ...

Need help with ASP.NET and escaping special characters?

Currently, I am working on a piece of code located in a .ASPX.CS page... img = "<img src=\"" + yellow + "\" align=\"middle\" onclick=\"alert('You are the current high bidder but the auction's minimum bid reserve has n ...

The initial axios GET request fails to retrieve data upon the first click

Having trouble retrieving data with button click. The issue is that the data is not fetched when clicking the button for the first time, but works fine on the second click. Here's the code snippet: const learnMores = document.querySelectorAll('. ...

Using AJAX to fetch an object and then comparing the JSON string data with the existing value

When my function receives an array object from an external API, I am able to convert it to JSON. Here is an example of how the JSON objects look: { "id": 99, "title": null, "author": "user", "content": "content", "u ...

What's the best way to refresh append() functionality within a modal? I'm currently working with NODE JS and AJAX and

Whenever I click the modal, the append() calls are adding HTML content. But if I try to use empty() or html(), the modal stops appearing altogether. What is the correct approach to creating this modal? function loadModalContent(id) { $('#myModal& ...

TemplateUrl malfunctioning

While experimenting with basic Angular code, I encountered an issue where everything was functioning correctly when using template, but not when switching to templateUrl. I did not provide the previous code as it was working fine except for this specific c ...

Select2.js Dropdown List with Case Sensitivity

Currently making use of select2.js version 4.0.3 Situation: Imagine the dropdown list contains the following options: JavaScript javascript Javascript javaScript So, when a user types in java, all options are displayed (case is n ...

What are the best options for storing small data in a React or Next.js project?

As I work on my personal portfolio using Next.JS, I've come to a point where I need to display multiple projects each with their own set of information like images, titles, and links. I'm wondering where would be the best place to store this data ...

JQuery auto complete using ajax response to populate data set is not displaying any results

I've encountered a problem with jQuery autocomplete using AJAX data as the source. The data is being returned correctly without any errors, yet the results are not displaying as expected. I've searched through various Stack Overflow questions re ...

The Angular Material table is failing to display any data and is throwing an error stating that _columnCssClassName is not

I have a challenge with my Angular Material application. I am attempting to display a list of customers received from an API call. The app compiles successfully, but I keep encountering this error in the browser console: ERROR Error: Uncaught (in promise ...

send information via an ajax call to trigger a callback function

Can data be passed through an Ajax request to the Callback function without using global variables? For example, can the request function pass the passData through the callback function while also getting normal response data? function makeRequest(callba ...

npm test is not passing and there is no error message provided

The current issue is that the tests are failing without any specific errors, only displaying the message mentioned above. Below is my test script: "test": "TEST=true tape test/core/*.js test/core/ui/user-interface.js test/core/modules/QR.js | tap-spec; b ...

Alter the status of a checkbox programmatically

There are two checkboxes available: <input type="checkbox" id="id3"></input> <input type="checkbox" id="id4"></input> The desired functionality is that when clicking on id3, id4 should also be checked. Initially, this works as e ...