Skip to content

Commit

Permalink
fix(module:code-editor): init event never emit when using static loading
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz committed Aug 14, 2020
1 parent f5899ad commit 0d06d61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/code-editor/code-editor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class NzCodeEditorService {

private loadMonacoScript(): void {
if (this.config.useStaticLoading) {
this.onLoad();
Promise.resolve().then(() => this.onLoad());
return;
}

Expand Down
5 changes: 1 addition & 4 deletions components/code-editor/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export interface NzCodeEditorConfig {
onInit?(): void;
}

export const NZ_CODE_EDITOR_CONFIG = new InjectionToken<NzCodeEditorConfig>('nz-code-editor-config', {
providedIn: 'root',
factory: NZ_CODE_EDITOR_CONFIG_FACTORY
});
export const NZ_CODE_EDITOR_CONFIG = new InjectionToken<NzCodeEditorConfig>('nz-code-editor-config');

export function NZ_CODE_EDITOR_CONFIG_FACTORY(): NzCodeEditorConfig {
return {};
Expand Down

0 comments on commit 0d06d61

Please sign in to comment.