How to import Metro variable in Angular 8

https://angular.io/
Post Reply
angular
Posts: 2
Joined: Sat Jun 29, 2019 6:29 pm
Status: Offline

How to import Metro variable in Angular 8

Post by angular » Sat Jun 29, 2019 6:38 pm

Hello, how to import Metro to use Metro.Notify and Metro.dialog in Angular 8?

Open(): void {
Metro.dialog.open('#demoDialog1');
}
It works but the compiler gives an error:
ERROR in src/app/components/pack/pack.component.ts(27,5): error TS2304: Cannot find name 'Metro'.

angular
Posts: 2
Joined: Sat Jun 29, 2019 6:29 pm
Status: Offline

Post by angular » Sat Jun 29, 2019 7:00 pm

You can use // @ts-ignore, then the compiler will not generate an error.
Example
// @ts-ignore
Metro.dialog.open('#demoDialog1');

Post Reply