小编har*_*avi的帖子

未捕获的 ReferenceError:ace 未在 angular 4 中定义

当我使用命令时,我有一个像这张图片一样的错误 ng serve --prod 像下面

当我在本地运行它时,npm start它运行良好!

在生产中运行时,它说“未定义王牌”?

代码表.component.html

<div class="codeEditor" ace-editor [(text)]="text" [mode]="languageMode" [theme]="editorTheme" [options]="options" [readOnly]="false"
    [autoUpdateContent]="true" [durationBeforeCallback]="1000" (textChanged)="codeChange($event)"></div>
Run Code Online (Sandbox Code Playgroud)

代码表.component.ts

import { Component, OnInit, ViewChild } from '@angular/core';
// import { AceEditorDirective } from 'ng2-ace';
// import { AceEditorDirective } from 'ng2-ace-editor';
import 'brace/theme/cobalt';
import 'brace/mode/c_cpp';
import 'brace/mode/java';
import 'brace/mode/python';
import 'brace/mode/ruby';
import { CompilerService } from '../compiler.service';
@Component({
  selector: 'app-code-table',
  templateUrl: './code-table.component.html',
  styleUrls: ['./code-table.component.css']
})
export class CodeTableComponent implements OnInit {
  text: string = "";
  loading: boolean …
Run Code Online (Sandbox Code Playgroud)

components module ace-editor angular

5
推荐指数
1
解决办法
2881
查看次数

标签 统计

ace-editor ×1

angular ×1

components ×1

module ×1