Scrolling infinitely within the side menu using ion-infinite-scroll

I'm encountering an issue with using Ion-infinite-scroll within ion-side-menu, as the load more function is not being triggered.

Is it permitted to utilize ion-infinite-scroll inside ion-side-menu?

Although I have added the directive, the method "loadMore()" is not being executed.

Here is the line of code I am using:

<ion-infinite-scroll on-infinite="loadMore()" ng-if="true" distance="10%"></ion-infinite-scroll>

and this is the loadMore() function:

$scope.loadMore = function() {
  console.log("showMore");
};

The complete HTML structure looks like this:

<ion-side-menus enable-menu-with-back-views="true" cache-view="false">
  <ion-side-menu-content ng-class="{'opaque-content' : isMenuOpen}">
    <ion-nav-bar class="bar-stable">

      <ion-nav-buttons side="left">
        <button class="button button-icon" menu-toggle="left">
          <img class="menu-icon" src="img/menu-icon.png" />
        </button>
      </ion-nav-buttons>
      <ion-nav-buttons side="right">
        <div class="button-icon">
          <img ng-show="showUserImage" class="default-channel-image" src="img/default-channel.png" />
          <img ng-show="showAnonymouseChannel" class="discussion-title-image img-border" src="img/anonymous-icon.png" />
        </div>
      </ion-nav-buttons>
    </ion-nav-bar>
    <ion-nav-view name="menuContent"></ion-nav-view>
  </ion-side-menu-content>

  <ion-side-menu side="left" width="320">
    <ion-header-bar class="bar-stable menu-background">
      <a class="setting-icon-wrapper" href="#/app/preferences" menu-close>
        <img class="settings-icon" src="img/settings.png" />
      </a>
      <form class="search-input-wrapper" ng-submit="search(discussionFilter.data)">
        <input type="text" id="searchFilter" class="search-input" ng-model="discussionFilter.data"  placeholder="Find channels..." ng-change="changeSearch(discussionFilter.data)" ng-model-options='{ debounce: 1000 }'/>
        <div ng-hide="discussionFilter.data != null && discussionFilter.data != ''"  class="search-icon-wrapper" ng-click="search(discussionFilter.data)">
          <i class="fa fa-search fa-2 search-icon"></i>
        </div>
        <div ng-show="discussionFilter.data != null && discussionFilter.data != ''" class="clear-search" data-ng-click="discussionFilter.data = '';search(discussionFilter.data)">
          <img src="img/clear-results.png" class="clear-results">
          </div>

      </form>

    </ion-header-bar>
    <ion-header-bar class="bar-subheader channels-header short-header" ng-show="discussions.length > 0" ng-class="">
      <div class="list-items-header channels-header" ng-show="discussions.length > 0">
        <p class="list-header-title">CHANNELS</p>
        <div class="create-channel-area" ng-click="MoveToNewChannel()" menu-close>
          <img class="plus-icon" src="img/plus-button.png"/>
        </div>
      </div>
    </ion-header-bar>
    <ion-content class="channel-headers menu-background" ng-show="discussions.length > 0" ng-click="closeKeyboard()">
      <ion-list class="menu-background menu-list" ng-click="closeKeyboard()">
        <ion-item class="menu-background"  menu-close ng-href="#/app/discussion/{{discussion.id}}" ng-click="closeKeyboard()" ng-repeat="discussion in discussions">

          <div class="menu-channel-text" ng-class="{'subject-regular' : discussion.read}"> {{discussion.subject | truncate_word:18}} </div>
        </ion-item>

      </ion-list>
      <!--<ion-infinite-scroll on-infinite="loadMore()" immediate-check="false" ng-if="isMenuOpen && showMoreDiscussions" distance="10%"></ion-infinite-scroll>-->
    </ion-content>


  </ion-side-menu>
</ion-side-menus>

Answer №1

The answer is as follows:

I appended

$scope.$broadcast('scroll.infiniteScrollComplete'); at the conclusion of my loadMore method.

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

Using Javascript, when the command key is pressed, open the link in a new window

Currently, I am working on a Javascript function that opens links in a new tab only when the "command" key is pressed on an Apple computer. Here is what I have so far: $(document).on('click','a[data-id]',function(e){ if(e.ctrlKey|| ...

Utilize React Hook Form to easily reset the value of an MUI Select component

I created a dropdown menu where users can select from "Item 1", "Item 2", and "Item 3". Additionally, there is a "Reset" button that allows users to clear their selection and make a new one. Below is the code I used: import React from ...

Updating the database table using javascript

I am looking to dynamically update my database based on a condition in JavaScript. Currently, I have been using the following approach: <a href="#" onclick="hello()">Update me</a> <script> function hello(smthing) { if(smthing == true) ...

Encountering TypeError: Unable to access the 'query' property as it is undefined

As I dive into learning AngularJS and sending requests to a Web API backend, I encountered the following error message: angular.js:13424 TypeError: Cannot read property 'query' of undefined In my project, I have a productListController define ...

I made a request using the post type fetch to submit data to this form, but unfortunately, the server-side response returned

I encountered an issue where after sending the post type fetch to this form, I received 'undefined' on the server side. Here's the code snippet for my fetch request: const { text, id } = Data; fetch('http://localhost:3001/add' ...

UI-router issue: UI view and links not functioning properly

Recently, I decided to implement ui-router for Angular in my project. After adding the following code snippet to my app module within the app.js file: angular .module("ngClassifieds", ['ngMaterial', 'ui.router']) .config(function($md ...

Implementing multiple modules within a shared parent route in Angular

Currently, I am seeking a method to load multiple modules under the same path in Angular. Let's say I have three modules: AModule, BModule, and CModule, each with its own RouterModule.forChild call. My goal is to combine these modules under the route ...

Issue with passing props to screen not displaying on initial load

Greetings, I'm a newcomer to the world of react native and currently facing an issue: const Tab = createMaterialTopTabNavigator(); export const CurriculumMenu = ({navigation, item}) => { const data = item.Title; console.log(data) return ( ...

Verify the password by checking each character as you type

Currently, I am trying to implement a real-time password matching feature. Is there anyone who can provide me with the code that verifies whether the entered passwords match character by character as they are being typed, and also checks the length upon ...

The output from the Angular .then function is not showing up on the webpage

Within my stucontrollers.j, I have the following code: /// <reference path="../angular.js" /> var stucontrollers = angular.module("stucontrollers", []); stucontrollers.controller("GetStudentsList", function GetStudentsList($scope, $http) { $ ...

What is the best way to execute a JavaScript file with npm scripts?

Trying to use npm but encountering some issues. In my package.json file, I have: "scripts": { "build": "build.js" } There is a build.js file in the same folder that simply console.logs. However, when I execute npm run build I receive the error messag ...

NgMap Angular Pins

While working on implementing Ng-Map for Angular in my application, I encountered an issue. I am retrieving entries from the database and attempting to drop markers on the map. However, even though I have 40 entries, only the first 11 are showing up as m ...

Ways to show dynamic text according to slider adjustments

I am struggling with adding an if condition to my form that includes a horizontal slider. My goal is to display text based on the position of the slider. Can someone offer some guidance on this, please? Here's my HTML code snippet: <form method=" ...

Modifying the background image of the <body> element in CSS to reflect the season based on the current month in the calendar

I'm struggling to change my HTML background based on the date. The code I've tried isn't working as expected and I can't seem to find any relevant examples to guide me. My goal is simple - I want the background of my HTML page to be ch ...

Activate the jquery function when the content of the <ul> element changes

Looking for a way to trigger a jQuery function when the content of an unordered list (ul) changes. Check out the code I've written below: JavaScript jQuery(document).ready(function($) { $('.ProductList').on('change', fun ...

Modify the menu class dynamically when scrolling using Angular and Bootstrap

I am a beginner in Angular and I am attempting to toggle between two Bootstrap menu classes when the page is scrolled. My goal is to keep the menu fixed at the top with a different background color (as defined in Bootstrap CSS) when the scroll is not at th ...

Adding functionality to delete buttons by incorporating "alert()"

I'm working on an Angular application that has multiple delete buttons, similar to this: <button class="btn btn-default" ng-click="delete($index)">x</button> As we are getting closer to deploying the app, I want the delete buttons to pro ...

Identifying a Resizable Div that Preserves its Aspect Ratio During Resizing

Below is the HTML code snippet I'm working with: <div id="myid_templates_editor_text_1" class="myid_templates_editor_element myid_templates_editor_text ui-resizable ui-draggable" style="width: 126.79999999999998px; height: 110px; position: absolut ...

Issue: Unable to locate module 'js-yaml' while executing npm start command

Unable to locate module 'js-yaml' Require stack: D:\REACT NATIVE\portfolio\node_modules\cosmiconfig\dist\loaders.js D:\REACT NATIVE\portfolio\node_modules\cosmiconfig\dist\createExplore ...

Access a folder in JavaScript using Flask

I need to specify a directory in a script. $images_dir = '{{url_for('.../pictures')}}'; In my flask application directory structure, it looks like this: Root -wep.py -templates -gallery.html -static -pictures The images are stored ...