我想在我的角度应用中使用萤火虫。
我没有看到任何角度为5的火药的例子。
我不知道如何将.ts绑定到html。使用.html和.ts文件的示例示例将是一个很好的帮助。
谢谢帕里
发布于 2018-05-07 18:31:35
回答我自己的问题:
类型标
import { Component, OnInit, ViewChild } from '@angular/core';
import { AceEditorComponent } from 'ng2-ace-editor';
import * as Firepad from 'firepad';
import * as firebase from 'firebase';
@Component({
selector: 'app-request-access',
templateUrl: './request-access.component.html',
styleUrls: ['./request-access.component.css']
})
export class RequestAccessComponent implements OnInit {
@ViewChild('firepad') firepadEle: AceEditorComponent;
constructor() { }
ngOnInit() {
let editor = this.firepadEle.getEditor();
let firepad = Firepad.fromACE(firebase.database().ref(), editor);
}
}<ace-editor
#firepad
mode="java"
theme="eclipse"
[options]="options"
[readOnly]="false"
[autoUpdateContent]="true"
class="ace-editor"
style="height:150px;">
</ace-editor>我们只需在html中使用AceEditorComponent,并在类型记录中使用它。
https://stackoverflow.com/questions/50154438
复制相似问题