The directives for ion-slide-page within ion-slides are experiencing rendering issues

Currently, I am working on an Ionic App (using an Ionic 1 codebase) and trying to incorporate the ion-slides/ion-slide-page directives into a page. However, I am facing difficulty in getting each individual ion-slide-page directive to sit horizontally next to each other as shown in the animated GIF example at http://ionicframework.com/docs/api/directive/ionSlides/.

This is how my controller looks:

.controller('ProductsController', function($scope, $ionicSlideBoxDelegate, ManageAppDatabase, )
{

            ManageAppDatabase.retrieveProductsFromDatabaseTable(function(numRecords)
            {

                $scope.products                                                                 =    numRecords;
                $scope.options = {
                    direction: 'horizontal',
                      loop: true,
                      effect: fade,
                      speed: 500
                }
                $scope.data = {};
                $scope.$watch('data.slider', function(nv, ov) 
                {
                  $scope.slider = $scope.data.slider;
                });
            });
}

Here is the HTML structure for the associated view:

<ion-view title="Products">
    <ion-content>
        
            <div class="carousel-container">
                <ion-slides  options="options" slider="data.slider">
                    <ion-slide-page class="carousel-slide" ng-repeat="product in products">
                        <img src="{{ product.image }}">
                         <h1>{{ product.title }}</h1>
                        <small>{{ product.date }}</small>
                        <div class="product-summary" ng-bind-html="product.summary | renderHTMLCorrectly"></div>
                      </ion-slide-page>
                </ion-slides>
            </div>

    </ion-content>
</ion-view>

The CSS (Sass) used in the above code snippet is:

.carousel-container {
    background: #e6e6e6;
}

.carousel-slide {
    padding:2.5% !important;   

    img {
        display: block;
        width: 100%;
        background: rgb(68, 68, 68);
        margin: 0;
    }


    h1 {
        padding: 0;
    }


    small {
        display: block;
        padding: 0 0 1em 0;
        font-size: 0.85em;
    }


    p {
        padding: 0 0 1.5em 0;
        font-size:0.9em;
        line-height:1.3em;
    }


    span {
        display: block;
        text-align:center;
        color:rgb(255, 255, 255);
        font-size: 0.75em;
    }
}

Despite all efforts, the HTML view template loads with every ion-slide-page stacked underneath one another. Could someone please guide me on what I might be missing or doing wrong? Any help would be greatly appreciated.

When I run ionic info in the command line, I receive the following output:

Cordova CLI: Not installed Gulp version: CLI version 1.2.1 Gulp local:
Ionic Version: 1.3.0 Ionic CLI Version: 1.7.14 Ionic App Lib Version: 0.7.0 ios-deploy version: Not installed ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v0.10.26 Xcode version: Xcode 7.3 Build version 7D175

Although Ionic seems up to date, the line Ionic App Lib Version: 0.7.0 remains unchanged even after running ionic lib update or creating a new ionic project. Is there something else that needs updating?

Your insights and advice would be invaluable in helping me resolve this issue promptly. Thank you!

Sincerely,

Answer №1

I encountered a similar issue to yours.

It appears that there may be something missing...

However, I noticed something unusual in your code. Are you confident that the provided controller is functioning correctly?

Were you trying to convey the following instead?

.controller('ProductsController', function($scope, $ionicSlideBoxDelegate, ManageAppDatabase) {
            
            ManageAppDatabase.retrieveProductsFromDatabaseTable(function(numRecords) {
                
                $scope.products = numRecords;
                $scope.options = {
                    direction: 'horizontal',
                    loop: true,
                    effect: fade,
                    speed: 500
                };
                $scope.data = {};
                $scope.$watch('data.slider', function(nv, ov) {
                    $scope.slider = ov.slider;
                });
            });
}

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

Is there a way to execute a function only once when the submit button is clicked in a jQuery AJAX form?

I am using Django to create a website where users can create groups. To allow users to fill in group information and upload an image as the group logo, I have implemented an HTML form. In order to preview the logo before submission, I have used AJAX to upl ...

What is the best way to send information from one screen to a flatlist in React Navigation?

Currently, I am retrieving data from an API in the form of a JSON file. My goal is to pass this data from the main app to the appStack and then to the sessionsStack before displaying it on the home page. However, my console logs indicate that the data only ...

Removing the rubber band scrolling feature on Mac computers

While I am pleased with the overall look of my website, I have noticed that users with trackpads on Macs experience distortion when accessing it. I am seeking assistance in addressing this issue, particularly in disabling or minimizing the impact of trackp ...

Differences in accessing the previous state between React's useCallback and useState's setState(prevState)

It has come to my attention that useCallback functions recreate themselves when their dependencies change, acting as a sort of wrapper for memoizing functions. This can be particularly useful for ensuring access to the most up-to-date state in useEffect ca ...

There was an issue converting the value {null} to the data type 'System.Int32', resulting in a 400 error

Attempting to make a POST request with some missing data is causing errors in my angular form. Here is the payload I am using: DeviceDetail{ deviceId:'332', sideId: null, deviceName:'test' } Unfortunately, I encountered a 400 bad re ...

Troubleshooting Node.js Application: Investigating Port Errors

After cloning a node.js application, I went through the setup process by running npm install and npm install -g nodemon. In order to run the application locally on port 3000, I added the following line in my app.js file: app.listen(3000, () => console. ...

Switch the design and save it in the browser's cache

Exploring the possibility of having two themes, "dark" and "light," that toggle when a checkbox is clicked. To implement the theme change, I used the following JavaScript code: document.documentElement.setAttribute('data-theme', 'dark&apos ...

AngularJS ng-repeat is not updating when the state changes

Seeking assistance with an Angular application challenge I'm facing. I have implemented a ng-repeat in my app to display the latest messages stored in an array within a controller named "comunicacion": ng-repeat in comunicacion.html <div class=" ...

Change the label's class when the input area is selected

Looking to add a new class to a label when its corresponding input element is in focus. A form consists of 10 input fields and 10 labels, one for each field. const inputFields = document.querySelectorAll('.form-control'); console.log(inputFie ...

`Is there a way to modify the attribute text of a JSON in jQuery?`

I'm attempting to modify the property name / attribute name of my JSON object. I attempted it like this but nothing seems to change. After reviewing the input JSON, I need to convert it to look like the output JSON below. function adjustData(data){ ...

I'm encountering an issue with the MUI DateTimePicker where I'm getting a TypeError that says "value.isValid is not a function at Adapter

Having some trouble with the MUI DateTimePicker component from the @mui/x-date-pickers library when using Day.js as the date adapter. Every time I attempt to utilize the DateTimePicker with Day.js, I encounter the following error: value.isValid is not a ...

Using React hooks to implement drag and drop functionality

As a backend engineer primarily, I've been struggling to implement a simple drag and drop feature for a slider I'm creating in React. Here's the behavior without using debounce: no-debounce And here's the behavior with debounce: with- ...

Value replaced by ajax response

Currently experimenting with Google Maps and the Geocoder, my goal is to iterate through a list of addresses, retrieve LatLng coordinates for each one, and then use that data to create markers using the setMarker function provided below. The issue I' ...

Having trouble with the "Cannot POST /public/ error" when converting a jQuery ajax call to vanilla JavaScript

Following up on a question from yesterday (Update HTML input value in node.js without changing pages), my goal is to submit an HTML form, send an ajax request to the server for two numbers, perform an addition operation on the server, and display the resul ...

"Utilize Node.js to seamlessly stream real-time Instagram photos based on a designated hashtag

Does anyone know of a node.js library or solution that can automatically fetch Instagram photos in real-time based on specific hashtags? ...

Load Vue dynamically to implement reCAPTCHA script

I am looking for a way to dynamically load a script like recaptcha specifically within the Register.Vue / login.Vue component. <script src="https://www.google.com/recaptcha/api.js?onload=vueRecaptchaApiLoaded&render=explicit" async defer> </s ...

Displaying decimal values in Angular as percentages

In my Angular application, I have a numeric textbox that displays a percentage value and allows users to update it. https://i.stack.imgur.com/eCOKe.png <label for="fees">Fees %</label> <div class="inpu ...

Cordova - Error: globalThis is not defined in the reference

I've been working through Cordova's Getting Started tutorial, but I hit a roadblock at the 2nd step. When I attempt to create my project using cordova create myApp, I encounter an error message that reads: C:\Users\foobar\AppData&b ...

Attempting to utilize JSON.Stringify on Scripting.Dictionary objects will result in failure

In my current ASP classic project, I have integrated the JScript JSON class available at this link. This class can interact with both VBScript and JScript, closely resembling the code provided on json.org. However, due to team manager's requirement, I ...

Refresh the information displayed in the open Google Maps Infowindow

Experimenting with extracting JSON data from a bus tracker website and integrating it into my own version using Google Maps. Although not as visually appealing, I'm struggling to update an infowindow while it remains open. Despite finding some example ...