A bug in the modal dialog is causing it to disregard the value of

I want to transfer certain modal properties in this manner

service.confirm = function(message, confirmProperties) {
        return $uibModal.open({
            templateUrl: 'app/modal/alert/alert.tpl.html',
            controller: 'alertController as vm',
            size: 'md',
            resolve: {
                alertData: function() {
                    return {
                        message: message,
                        type: 'QUESTION',
                        customButtons: confirmProperties.button1 && confirmProperties.button2 ? [confirmProperties.button1, confirmProperties.button2] : undefined,
                        cancelButton: confirmProperties.cancelButton,
                        title: confirmProperties.title,
                        ignoreWhiteSpaces: confirmProperties.ignoreWhiteSpaces
                    }
                }
            },
            backdrop: true,
            keyboard: true
        });
    };

When I call my function, all properties are passed correctly except for the 'ignoreWhiteSpaces' one... Even when I pass false, it ends up being undefined. Why is that happening? I've spent more than an hour attempting to solve this issue.

var confirmProperties = {
                    button1: 'Update Existing Contracts',
                    button2: 'No Update to Existing Contracts',
                    cancelButton: true,
                    title: 'Update Service on the Customers Existing Contracts',
                    ignoreWhiteSpace: false
                };
appState.confirm('This is the message.', confirmProperties);

https://i.sstatic.net/xmtOe.png

Answer №1

There is a small error in your code. Instead of using ignoreWhiteSpace, it should be ignoreWhiteSpaces. Make the following change in your code:

var confirmProperties = {
                button1: 'Update Existing Contracts',
                button2: 'No Update to Existing Contracts',
                cancelButton: true,
                title: 'Update Service on the Customers Existing Contracts',
                ignoreWhiteSpace: false
            };

Corrected code:

var confirmProperties = {
                button1: 'Update Existing Contracts',
                button2: 'No Update to Existing Contracts',
                cancelButton: true,
                title: 'Update Service on the Customers Existing Contracts',
                ignoreWhiteSpaces: false
            };

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

Move the option from one box to another in jQuery and retain its value

Hey guys, I need some assistance with a jQuery function. The first set of boxes works perfectly with the left and right buttons, but the second set is not functioning properly and doesn't display its price value. I want to fix it so that when I click ...

Tips for disabling viewport resizer while accessing the Console panel in Chrome using Control+Shift+J

Currently, I am utilizing the viewport resizer in Chrome to preview how my code appears on various devices. However, I have encountered an issue - whenever I try to access the console using ctrl + shift + j, the viewport resizer opens instead. You can obs ...

What is the process for showcasing a local notification within my application?

Here is the code snippet I am working with: import { LocalNotifications } from '@ionic-native/local-notifications'; @Component({ selector: 'app-home', templateUrl: 'home.page.html', styleUrls: ['home.page.scs ...

Accessing router parameters in Vuex actions

Is there a more efficient way to pass router params into Vuex actions for a large form? edit_sport_type({ rootState, state, commit }, event) { const sportName = rootState.route.params.sportName <------- const payload = {sportName, event} ...

Global asynchronous functionality can be enabled in JavaScript

Wouldn't it be convenient to have the option to enable async functionality in the global scope? This way, there would be no need to wrap all asynchronous operations within a function. I'm curious if this is achievable in browser JavaScript or per ...

Tips for retrieving Angular JSON data

Can someone assist me with extracting separate values from the JSON returned by an API? { ACC: "{"NO":"AC307","NAME":"joe"}, RETURN: "TRUE" } I need to retrieve the values individually, such as NO and NAME. How can I achieve this? Below is a snippet of ...

Issue with parallax scroll feature on Mobile Safari not functioning as expected

I created a JavaScript code for parallax scrolling on an image at the top of a webpage. The code functions perfectly on Chrome, Firefox, Internet Explorer, Opera, and Safari on desktop. However, when I tested it on Safari on my iPad, the parallax effect wa ...

Guide to enclosing selected text within a span tag and positioning a div in relation to it using JavaScript

My main objective is to enable the user to: highlight text within a paragraph enclose the highlighted text in a span element add an action button or div at the end of the selected text for further interaction Here's the code I've worked on so ...

Race condition in AngularJS directive issue

Within my directive, there are two attributes being passed from the controller: 1. A title object 2. An onchange function scope: { title: '=', change: '&' } // In the link function, I update the object and call the functi ...

How to display information from a JSON file using dynamic routing in a React.js application

I'm currently working on a project to replicate Netflix using reactjs, but I've hit a roadblock and can't figure out what to do next. I've tried watching YouTube tutorials and reading articles online, but I haven't been able to fin ...

JavaScript's asynchronous callbacks

As a PHP developer delving into the world of NodeJS, I find myself struggling to fully grasp the concept of asynchrony in JavaScript/Node. Consider this example with ExpressJS: router.get('/:id', function (req, res, next) { var id = req.par ...

Unable to perform the GET request method due to data indicating [object object]

Currently, I am attempting to use a get request method within both Vue and Express in order to retrieve data based on my v-model. Displayed below is the code where I am trying to send the data to Express. getResult() { axios .get( `${process. ...

Protractor: Decrease the magnification

Currently, I am working with protractor and facing the challenge of zooming out to 50%. Despite trying numerous solutions found on StackOverflow, none have successfully resolved the issue. Some attempted solutions include: browser.actions().keyDown(protra ...

Challenge implementing custom javascript to display categorical/string features on Shiny slider

I'm attempting to design a unique Shiny slider that represents the months of the year. My desired outcome is for the slider to display the names of the months as strings, rather than numeric values where 1 corresponds to January, 2 corresponds to Febr ...

What is the process for redirecting to a different URL when the button is clicked?"

I am trying to display Home.js at localhost/posts, but when the button is clicked, it displays information at the auth.js URL. How can I link the button so that if the login information is correct, it redirects to "localhost/posts" instead of rendering its ...

using spread operator to extract properties from API response objects

Currently undergoing a React/Next course, we recently had to retrieve data from an API that returns a list of objects containing information to populate the page. This task was accomplished using Next's getStaticProps method, passing the data to the ...

Is it possible to remove a particular div after clicking the delete button, especially if multiple divs are displayed upon clicking the add

var count = 2; var countMax = 5; function adddt() { if (count > countMax) return; document.getElementById('dt-' + count + '').style.display = 'block'; count++; } <link href="https://maxcdn.bootstrapcdn.com/bo ...

Tips for launching and troubleshooting an AngularJS application within Eclipse

Looking to dive into Nodeclipse and get up and running with debugging an AngularJS application like the angular-phonecat example from Eclipse. Specifically, I want to utilize a Debug on Server launcher to kick off a server with my app and launch a web b ...

The functionality of Vue is acting up with the HTML, unexpectedly refreshing when a button is clicked

I am currently experiencing an issue with my Vue application. When I click the button, it clears the input field (which it shouldn't) and doesn't perform any other actions. The variables "codigo" and "payload" do not display anything on the scree ...

Implementing a language switch feature for text display in Node.js and Next.js websites

One of the features my client is requesting for a web app is dual language support, where users can easily switch between French and English. To address this requirement, I incorporated a button that toggles a state and saves the user's language pref ...