import { RhAppConfigService } from 'rh-base/core'; import { Component, OnInit } from '@angular/core'; import { NzModalService } from 'ng-zorro-antd/modal'; import { NzMessageService } from 'ng-zorro-antd/message'; // import { TranslateService } from '@ngx-translate/core'; import { RhSafeAny } from 'rh-base/model'; import { RhRouteHelperService } from 'rh-base/core'; import { AppService } from './app.service'; import { HttpClient } from '@angular/common/http'; import { DomSanitizer } from '@angular/platform-browser'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.less'] }) export class AppComponent implements OnInit { constructor( // private router: Router, // private route: ActivatedRoute, private modalService: NzModalService, private msgService: NzMessageService, // public translateService: TranslateService, public appSer: AppService, private http: HttpClient, private sanitizer: DomSanitizer, routerHelper: RhRouteHelperService, public appconfigSer: RhAppConfigService ) { (window as RhSafeAny).ulModalService = this.modalService; (window as RhSafeAny).ulMessageService = this.msgService; (window as RhSafeAny).http = this.http; (window as RhSafeAny).sanitizer = this.sanitizer; // 设置pdf预览需要的js路径,防止请求外网 (window as RhSafeAny).pdfWorkerSrc = 'assets/js/pdf.worker.min.js'; (window as RhSafeAny).enableDebug = () => { this.appSer.debugSubjectTrigger(true); }; (window as RhSafeAny).disableDebug = () => { this.appSer.debugSubjectTrigger(false); }; // 异常捕抓 routerHelper.routerErrorHandler(); } ngOnInit() { // console.log(this.appSer.appconfig); // console.log(this.appSer.projectConfig); } }