我有 Angular CLI:7.3.4,节点:10.15.1。我有npm install qz-tray。我有我的 service.ts:
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import { from , Observable } from 'rxjs';
import * as qz from 'qz-tray';
import { sha256 } from 'js-sha256';
declare var qz: any;
@Injectable({
providedIn: 'root'
})
export class PrintingService {
constructor() { }
errorHandler(error: any): Observable<any> {
return Observable.throw(error);
}
}
我有这个错误找不到模块'qz-tray'的声明文件。'../node_modules/qz-tray/qz-tray.js' 在 import 语句中隐含了一个 'any' 类型。我遵循了以下示例: https ://medium.com/@yehandjoe/angular-2-raw-printing-service-56614d358754 任何帮助表示赞赏。我正在尝试打印原始文本。我也对任何其他图书馆开放。谢谢