Unable to determine all parameters for Modal: (?, ?, ?)

import { Component, Inject } from '@angular/core';
import { NavController, Modal } from 'ionic-angular';

import { PopupPage } from '../../components/modal/modal.page';

@Component({
  templateUrl: 'build/pages/spot/spot.html',
  providers: [ Modal ]
})
export class SpotComponent {

  constructor(@Inject(Modal) private modal: Modal ) {}
}

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

Answer №1

As mentioned by @Pace, you can refer to the Ionic2 documentation for guidance on how to generate a Modal.

There is no need to include it in the providers array or in your constructor as you are currently doing. Instead, utilize the Modal.create(...) method as demonstrated below:

import { Modal, NavController, NavParams } from 'ionic-angular';

@Component(...)
class HomePage {

 constructor(/* ..., */ private nav: NavController) {
   // Your code...
 }

 presentProfileModal() {
   // Create the modal using the layout from the Profile Component
   let profileModal = Modal.create(Profile, { paramId: 12345 });

   // Show the modal
   this.nav.present(profileModal);
 }

}

@Component(...)
class Profile {

 constructor(/* ..., */ private params: NavParams) {
   // Retrieve the parameter using NavParams
   console.log('paramId', params.get('paramId'));
 }

}

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

The object is classified as 'undetermined' (2571) upon implementation of map() function

Despite conducting a thorough search about this error online, I still haven't been able to find a solution. Let's jump into an example with data that looks like this: const earthData = { distanceFromSun: 149280000, continents: { asia: {a ...

Showing Firebase messages in a NativeScript ListView in an asynchronous manner

I am currently struggling to display asynchronous messages in a ListView using data fetched from Firebase through the popular NativeScript Plugin. While I have successfully initialized, logged in, and received the messages, I'm facing challenges in ge ...

Is it acceptable to include a @types library as a regular dependency in the package.json file of a Typescript library?

Should the library also be compatible with Typescript projects? I am developing a Typescript library that utilizes node-fetch and @types/node-fetch, which will be shared through an internal NPM registry within the company. If I only include @types/node-f ...

What is the reason behind useEffect giving warnings for unnecessary fields that are not included in the dependencies array?

After reviewing the documentation for useEffect, I am puzzled by the warnings I receive for every variable and function used within useEffect, despite not having a dependency on them. Take a look at my useEffect below: const [updatedComm, setUpdatedComm] ...

Typescript Event Handling in React Select

I am facing an issue with my handleSelect function: const handlerSelectBank = (event: React.ChangeEvent<{ value: unknown }>) => { setState({ ...state, buttonDisabled: false, selectedBank: event }); }; Upon execution, I encountered ...

Guide on incorporating external .d.ts files for a module

I'm currently delving into the process of utilizing an external .d.ts file that is not included in the module. My intention is to make use of xlsx, which lacks its own type definitions, and instead incorporate them from the package @types/xlsx. Afte ...

"iOS users have reported that notifications from Firebase have mysteriously ceased to

Yesterday evening, I was experimenting with Push Notifications from Firebase on my iOS application and everything was functioning correctly. I successfully sent a notification from a Cloud Function to a specific FCM token. However, this morning, notificat ...

Issues arise when attempting to assign GraphQL types, generics, and NestJS Type<> as they are not interchangeable with Type<&

I've been attempting to use this definition: import { GraphQLScalarType } from 'graphql'; import { Type } from '@nestjs/common'; export function createFilterClass<T extends typeof GraphQLScalarType>( FilterType: Type&l ...

Having trouble compiling a basic application with npm link to access an external library

After attempting to establish a basic component library for consumption by an application and connecting them using npm link, I encountered errors during compilation and am unsure of what steps I may have missed. The structure is minimal, intended solely t ...

Dealing with Typescript in Node.js: Handling the error 'Property not found on type Global & typeof globalThis'

I recently encountered an issue with my NodeJS app that is built with typescript and global.d.ts file. The strange part is that everything works fine in my old application, but when I try to run the new one using ts-node-dev ts-main-file.ts, I encounter an ...

Exploring the world of Vue and Pinia: managing and accessing data like

While delving into Vue and Pinia, I encountered a data management issue on the user side. On my main page, I showcase categories and auction items. However, upon navigating to a specific category in the catalog, the data for auction items remains in the st ...

Effortless column organization with Bootstrap

My goal is to simplify my column arrangement based on a boolean value. If the value is false <div class="row"> <div class="col-4">A</div> <div class="col-4">B</div> ...

"Is There a Specific Order for Organizing Angular Router

Could you please clarify the difference between these two code snippets? const routes: Routes = [ { path: '', canActivate: [AuthGuard], component: MainComponent, children: [ { path: '', component: DashboardComponent }, ...

"Unlocking the Power of Ionic: A Guide to Detecting Status 302 URL Redirects

Trying to handle a http.post() request that results in a 302 redirect, but struggling to extract the redirected URL. Any tips on how to achieve this? Appreciate any help. ...

Using Angular2, summon numerous ajax requests and then patiently wait for the results

I'm facing an issue with my Angular code. Here are the functions I've been working on: private callUserInfo(): any { this.isLoading = true; return this._ajaxService.getService('/system/ping') .map( result => { this.user ...

When sending an HTTP POST request to a Nodejs service with an uploaded file, the request fails after 8-15 seconds on Firefox and 25 seconds on Chrome

My web app is built on Angular 7. I am facing an issue while trying to send larger files to a Node.js service. Smaller files, around 3mb, are being sent successfully but when attempting to send bigger files like 20mb, the request gets cut off. In Chrome, I ...

Tips for invoking an Android function from an AngularJS directive?

I am facing an issue with my HTML that uses an AngularJS directive. This HTML file is being used in an Android WebView, and I want to be able to call an Android method from this directive (Learn how to call Android method from JS here). Below is the code ...

Firebase functions are giving me a headache with this error message: "TypeError: elements.get is not

Encountering the following error log while executing a firebase function to fetch documents and values from the recentPosts array field. Error: Unknown error status: Error: Unknown error status: TypeError: elements.get is not a function at new HttpsEr ...

Angular is not rendering styles correctly

Having two DOMs as depicted in the figures, I'm facing an issue where the circled <div class=panel-heading largeText"> in the first template receives a style of [_ngcontent-c1], while that same <div> gets the style of panel-primary > .p ...

Writing Data to Google Cloud Firestore Map using NextJS and Typescript with nested objects

I could use some assistance. I'm developing an application using NextJS (React), TypeScript, and Google Cloud Firestore. Everything seems to be working fine so far. However, I'm facing an issue with storing the address and phone number in a neste ...