Skip to content
Permalink
Browse files

fix(module:editor): fix type any (#4105)

close #4099
  • Loading branch information...
wendzhue authored and hsuanxyz committed Sep 6, 2019
1 parent bb9e89f commit bd720fb45fa944d4c02326d38d959c8796d105fc
Showing with 8 additions and 6 deletions.
  1. +5 −2 components/code-editor/demo/complex.ts
  2. +3 −4 components/code-editor/demo/full-control.ts
@@ -74,13 +74,16 @@ export class NzDemoCodeEditorComplexComponent {
}
console.log(flatten(['1', 2, [[3]]]))`;
private document: Document;

// tslint:disable-next-line no-any
constructor(@Inject(DOCUMENT) private document: any, private renderer: Renderer2) {}
constructor(@Inject(DOCUMENT) document: any, private renderer: Renderer2) {
this.document = document;
}

toggleFullScreen(): void {
this.fullScreen = !this.fullScreen;
this.renderer.setStyle((this.document as Document).body, 'overflow-y', this.fullScreen ? 'hidden' : null);
this.renderer.setStyle(this.document.body, 'overflow-y', this.fullScreen ? 'hidden' : null);
this.editorComponent.layout();
this.tooltip.hide();
}
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { editor } from 'monaco-editor';

// tslint:disable-next-line no-any
declare const monaco: any;
@@ -17,16 +18,14 @@ declare const monaco: any;
]
})
export class NzDemoCodeEditorFullControlComponent {
// tslint:disable-next-line no-any
editor: any;
editor: editor.ICodeEditor;

code = `import { NzCodeEditorModule } from 'ng-zorro-antd/code-editor'
@Component({})
export class SomeComponent {}`;

// tslint:disable-next-line no-any
onEditorInit(e: any): void {
onEditorInit(e: editor.ICodeEditor): void {
this.editor = e;
this.editor.setModel(monaco.editor.createModel("console.log('Hello ng-zorro-antd')", 'typescript'));
}

0 comments on commit bd720fb

Please sign in to comment.
You can’t perform that action at this time.