Ionic 3 is unable to find a provider for CallNumber

Recently, I have been working with Ionic 3 and encountered an issue when trying to call a number using the Call Number plugin. Here are the steps I followed to add the plugin:

ionic cordova plugin add call-number
npm install --save @ionic-native/call-number

However, upon implementation, I received the following error message:

ERROR Error: Uncaught (in promise): Error: No provider for CallNumber!

Answer №1

Don't forget to include CallNumber in the providers array within your AppModule (found in the app.module.ts file):

// ...
import { CallNumber } from '@ionic-native/call-number';

@NgModule({
  declarations: [..],
  imports: [...],
  bootstrap: [IonicApp],
  entryComponents: [...],
  providers: [
    CallNumber, // <--- Make sure it's added here! :)
    ...
    ...
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

Answer №2

Include the following provider in your app.module.ts file

providers: [
    CallNumber, 
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]

Answer №3

insert the following code into your page.ts file

@Component({
selector: 'app-root',
templateUrl : './app.component.html',
providers : [CallNumber]

Answer №4

Another way to achieve this is by utilizing the following method

<a href="tel:+1234567890">CALL</a>

To ensure proper functionality, it is important to include the code snippet below in the config.xml file

<allow-intent href="tel:*" />

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

Arranging Objects by Alphabetical Order in Typescript

I am struggling with sorting a list of objects by a string property. The property values are in the format D1, D2 ... D10 ... DXX, always starting with a D followed by a number. However, when I attempt to sort the array using the following code snippet, it ...

Sending properties to MUI Box component enhancer (Typescript)

I'm having trouble figuring out how to pass props to override the Box component. I specifically need to pass position="end" as InputAdornment requires it, but I can't seem to find the proper way in the documentation. Here's the complete co ...

Angular bootstrap search is encountering an issue with locating a supporting object. It seems to be struggling to find a differ for the object of type 'object'

I recently delved into learning autoComplete Search. While I successfully retrieved the object from the backend server, displaying them in HTML resulted in the following error. NgbTypeaheadWindow.html:5 ERROR Error: Cannot find a differ supporting object ...

Guide on linking an object retrieved from an API to an input text field in Angular

I have been working on reading API responses in Angular and displaying them in input text fields. While I am able to successfully call the API and view the response in the console, I am facing challenges when it comes to capturing the response in an object ...

Reactjs-ffsevents does not exist as a function

An error occurred: TypeError: fsevents is not a function. This issue is located in the FSEventsWatcher file at line 162. A new FSEventsWatcher was attempted to be created in jest-haste-map, triggering this error. The watcher creation process involved map ...

When I refresh the page in Angular2, the router parameters do not get loaded again

When loading my application on routers without parameters, everything is normal. However, when trying to use a router with params, the application fails to load. For example: localhost:3000/usersid/:id The code for the router is as follows: const appRou ...

Guide on integrating a plain Service/Provider into nest.js

I recently created a basic TypeScript class in nest.js called JwtTokenService.js. // JwtTokenService.js import { Injectable, Optional } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; import { JwtPayload } from ' ...

What steps are involved in creating a local unleash client for feature flagging?

Currently attempting to implement a feature flag for a Typescript project using code from the Unleash Client. Here is where I am creating and connecting to an instance of unleash with a local unleash setup as outlined in this documentation: Unleash GitHub ...

The modules 'MdCardModule' and 'MdTooltipModule' do not have any exported members

Encountering Errors After Running ng build Issue found in C:/761/search- bar/workload_management_app/Client/src/app/app.module.ts (8,9): Module '"C:/761/search- bar/workload_management_app/Client/node_modules/@angular/materia ...

Using Promise.all for multiple function calls

I have several functions set up like this: private async p1(): Promise<Result> { let p1; // Do some operations. return p1; } private async p5(): Promise<void> { // Make a call to an external API. } Some of these functions c ...

Defining RefObject effectively in TypeScript

Greetings everyone, I am a newcomer to TypeScript and currently attempting to create a type for a RefObject that is of type HTMLAudioElement. However, I have encountered an error message. The error states: Type 'MutableRefObject<HTMLAudioElement> ...

Error NG8001: The element 'router-outlet' is not recognized: Make sure that 'router-outlet' is a component in Angular, and confirm that it is included in this module

Having trouble running ng serve or ng build due to an error message stating that 'router-outlet' is not a recognized element. The Angular application structure looks like this: app.module.ts: import { NgModule } from '@angular/core'; i ...

Utilizing ngModel with an uninitialized object

What is the most effective way to populate an empty instance of a class with values? For example, I have a User Class and need to create a new user. In my component, I initialize an empty User Object "user: User;". The constructor sets some properties, w ...

How should I set up my TestBed configuration in Jasmine test scenarios within an Angular environment?

As I begin writing test cases for Angular, I've come across various ways to configure my TestBed by reading articles online. Here are a few examples: Example 1: beforeEach(async(() => { TestBed.configureTestingModule({ ... }).compileCompone ...

What could be the reason behind the frequent appearance of multiple calls in Fiddler upon initiating a SignalR connection

As I set up a signalr connection from my angular front-end to an Asp.Net Core back-end, multiple calls are being made when starting the connection. The issue arises with the first call not completing, which poses a problem for our end-to-end tests. Attemp ...

Deployment error on Google App Engine for Angular Universal 13 and Angularfire 7

Upgrading my app from Angular 12 to Angular 13 has caused deployment issues on Google App Engine. The error message reads: ERROR: (gcloud.app.deploy) Error Response: [9] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/ ...

Using Typescript in NextJS 13 application router, implement asynchronous fetching with async/await

Recently, I implemented a fetch feature using TypeScript for my NextJS 13 project. As I am still getting familiar with TypeScript, I wanted to double-check if my approach is correct and if there are any potential oversights. Here is the code snippet from ...

Mastering the usage of Higher Order Components (HOC) with both types of props is

I am facing a challenge in implementing HOCs for this specific scenario. I aim to enclose existing components since they share similar functionalities. Below is an abridged version of my current structure: function CreateComponentHere(props: BaseProps): J ...

Is moduleId a reserved word in Angular2 / CLI?

After downloading the newest CLI version, I initiated a fresh test project. angular2 version: "^2.3.1" "@angular/compiler-cli": "^2.3.1", "typescript": "~2.0.3" Within AppComponent, there is this constructor: export class AppComponent ...

What is the best way to update the value of a Material Angular select to match its label in TypeScript?

Is there a way to reset the value of this select element back to <mat-label>Select Member</mat-label> in TypeScript when a specific event occurs? I am currently unable to find a solution on the TypeScript side. Any advice would be appreciated ...