Skip to content

Error: "'CallLog' refers to a value, but is being used as a type here." when trying to use CallLog in a component #14

@cedricbonhomme

Description

@cedricbonhomme

Hello,

I would like to use a callLog object in my component.

Below is my constructor:

import { Component } from '@angular/core';
import { Loading, LoadingController, AlertController } from 'ionic-angular';

@Component({
  selector: 'page-spam',
  templateUrl: 'spam.html'
})
export class SpamPage {
    constructor(public callLog: CallLog, public alertCtrl:AlertController, public loadingCtrl: LoadingController) { 
    ...
    <snap>
    ...
    }
}

Also CallLog is defined in the providers (app.components.ts).
And the error I get is:

Typescript Error
'CallLog' refers to a value, but is being used as a type here.

Also if I want to define a callLog variable outside the constructor I need to do it like this:

callLog: typeOf CallLog

I must use typeOf.

I do not know what I am doing wrong. I followed some tutorials and it does not help me. I am using Typescript 3.4.5.

Can someone help me ? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions