Skip to content

Commit

Permalink
fix(module:editor): fix type any (NG-ZORRO#4105)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wendell authored and hsuanxyz committed Sep 6, 2019
1 parent 7d0d576 commit 0ded4ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 5 additions & 2 deletions components/code-editor/demo/complex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
7 changes: 3 additions & 4 deletions components/code-editor/demo/full-control.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { editor } from 'monaco-editor';

// tslint:disable-next-line no-any
declare const monaco: any;
Expand All @@ -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'));
}
Expand Down

0 comments on commit 0ded4ec

Please sign in to comment.