开源软件名称(OpenSource Name):lon-yang/ngx-markdown-editor开源软件地址(OpenSource Url):https://github.com/lon-yang/ngx-markdown-editor开源编程语言(OpenSource Language):TypeScript 75.1%开源软件介绍(OpenSource Introduction):ngx-markdown-editorAngular markdown editor based on ace editor UsageInstallation>=3.0.0Install dependencies from npm repository:npm i ace-builds bootstrap font-awesome Install npm i ngx-markdown-editor Add the assets、styles and scripts in {
...
"architect": {
"build": {
"options": {
...
"assets": [
{
"glob": "**/*",
"input": "node_modules/ace-builds/src-min",
"output": "./assets/ace-builds/"
}
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/font-awesome/css/font-awesome.min.css",
"node_modules/ngx-markdown-editor/assets/highlight.js/agate.min.css"
],
"scripts": [
"node_modules/ngx-markdown-editor/assets/highlight.js/highlight.min.js",
"node_modules/ngx-markdown-editor/assets/marked.min.js"
]
...
}
}
}
...
} Add <html>
<head>
<script src="/assets/ace-builds/ace.js"></script>
</head>
<body></body>
</html> <=2.5.0Install dependencies from npm repository:npm i brace bootstrap font-awesome Install npm i ngx-markdown-editor Add the styles and scripts in {
...
"architect": {
"build": {
"options": {
...
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/font-awesome/css/font-awesome.min.css",
"node_modules/ngx-markdown-editor/assets/highlight.js/agate.min.css"
],
"scripts": [
"node_modules/ngx-markdown-editor/assets/highlight.js/highlight.min.js",
"node_modules/ngx-markdown-editor/assets/marked.min.js"
]
...
}
}
}
...
} Import import 'brace';
import 'brace/mode/markdown'; Sampleimport { LMarkdownEditorModule } from 'ngx-markdown-editor';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule, // make sure FormsModule is imported to make ngModel work
LMarkdownEditorModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { } <md-editor name="Content"
[upload]="doUpload"
[preRender]="preRenderFunc"
[postRender]="postRenderFunc"
[(ngModel)]="content"
[height]="'200px'"
[mode]="mode"
[options]="options"
(onEditorLoaded)="onEditorLoaded($event)"
(onPreviewDomChanged)="onPreviewDomChanged($event)"
required
maxlength="500">
</md-editor> Options
Event
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论