ОШИБКА ReferenceError: cordova не определена в проекте Angular

#angular #cordova #plugins #cordova-plugins

Вопрос:

ошибка

индексный файл

компонент , в котором я вызываю cordova, для доступа к плагину, но получаю ошибку, я уже добавил cordova в index .html

 import { Component, OnInit } from '@angular/core';
import { ConstantFactory } from '../shared/constants';
declare var cordova: any;
@Component({
  selector: 'app-landing-page',
  templateUrl: './landing-page.component.html',
  styleUrls: ['./landing-page.component.scss']
})
export class LandingPageComponent implements OnInit {
  title
  constructor(private c: ConstantFactory) { }

  ngOnInit(): void {
    this.title = this.c.TITLE
    this.testPlugin()
  }

  testPlugin() {
    cordova.plugins.LogicLinkPlugin.coolMethod("coolMethod", function (response) {
      console.log(response);
    }, function (error) {
      console.log(error);
    });
  }
}