Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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