第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

ace.edit 在 mat-tab 中找不到 div #javascript-editor

ace.edit 在 mat-tab 中找不到 div #javascript-editor

眼眸繁星 2021-11-12 14:59:00
我正在嘗試創(chuàng)建一個(gè) ace 編輯器,該編輯器在角材料中使用時(shí)會(huì)引發(fā)錯(cuò)誤ace.edit 找不到 div #javascript-editor我在這里有我的代碼StackBlitz(檢查控制臺(tái)是否有錯(cuò)誤)應(yīng)用程序組件.html<mat-tab-group>  <mat-tab label="Editor">    <h4>Custom Editor</h4>    <div id="javascript-editor" style="height: 300px;"></div>  </mat-tab></mat-tab-group>app.component.tsimport { Component, OnInit } from '@angular/core';import * as ace from 'brace';import 'brace/mode/javascript';import 'brace/theme/monokai';@Component({  selector: 'my-app',  templateUrl: './app.component.html',  styleUrls: [ './app.component.css' ]})export class AppComponent implements OnInit {  ngOnInit() {    const editor = ace.edit('javascript-editor');    editor.getSession().setMode('ace/mode/javascript');    editor.setTheme('ace/theme/monokai');  }}
查看完整描述

1 回答

?
楊魅力

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超6個(gè)贊

當(dāng) javascript-editor 元素尚未創(chuàng)建時(shí),您正在調(diào)用 ace.edit,請(qǐng)嘗試從而ngAfterViewInit不是調(diào)用它ngOnInit。


查看完整回答
反對(duì) 回復(fù) 2021-11-12
  • 1 回答
  • 0 關(guān)注
  • 357 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)