All Projects → lula → Ngx Summernote

lula / Ngx Summernote

Licence: mit
Summernote editor for Angular 😎

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ngx Summernote

Angular Froala Wysiwyg
Angular 4, 5, 6, 7, 8 and 9 plugin for Froala WYSIWYG HTML Rich Text Editor.
Stars: ✭ 696 (+815.79%)
Mutual labels:  wysiwyg-editor, angular6
Ngx Excel Export
Angular6 application with export data to excel file functionality.
Stars: ✭ 58 (-23.68%)
Mutual labels:  angular6
Angular Github Issues
This repository searches github for repositories, issues, and users. It is written in Angular 10 and is using ngrx/store for state.
Stars: ✭ 18 (-76.32%)
Mutual labels:  angular6
Grav Plugin Tinymce Editor
TinyMCE Editor Integration Plugin for Grav
Stars: ✭ 44 (-42.11%)
Mutual labels:  wysiwyg-editor
Flask Scaffold
Prototype Database driven Web apps in Angular 6, Bootstrap 4 and REST API's with Flask (Python 3 framework)
Stars: ✭ 853 (+1022.37%)
Mutual labels:  angular6
Angular Draggable Mat Tree
Example implementation of drag and drop on Angular Material Tree
Stars: ✭ 47 (-38.16%)
Mutual labels:  angular6
Shiftscheduler
A boilerplate ASP.NET Core project, including a sample employee shift scheduler app
Stars: ✭ 5 (-93.42%)
Mutual labels:  angular6
Mean Stack Angular6 Crud Example
MEAN Stack Angular 6 CRUD Web Application
Stars: ✭ 69 (-9.21%)
Mutual labels:  angular6
Angular2 Tree Diagram
Angular Hierarchical UI module
Stars: ✭ 50 (-34.21%)
Mutual labels:  angular6
Megadraft
Megadraft is a Rich Text editor built on top of Facebook's Draft.JS featuring a nice default base of components and extensibility
Stars: ✭ 982 (+1192.11%)
Mutual labels:  wysiwyg-editor
Angular Espanol
Recursos, tutoriales y artículos para aprender Angular en español
Stars: ✭ 31 (-59.21%)
Mutual labels:  angular6
Contact App
Contact Application using ASP.NET Core Web API, Angular 6.0, and Visual Studio Code
Stars: ✭ 11 (-85.53%)
Mutual labels:  angular6
Canner Slate Editor
📝Rich Text / WYSIWYG Editor built for Modularity and Extensibility.
Stars: ✭ 1,071 (+1309.21%)
Mutual labels:  wysiwyg-editor
Laravel Angular6 Material
Laravel 5.6 + Angular 6 + Material Design single page application
Stars: ✭ 19 (-75%)
Mutual labels:  angular6
Sharebook Frontend
Projeto frontend de código livre para o app Sharebook.
Stars: ✭ 59 (-22.37%)
Mutual labels:  angular6
Dante2
A complete rewrite of dante editor in draft-js
Stars: ✭ 890 (+1071.05%)
Mutual labels:  wysiwyg-editor
Jodit
Jodit - Best WYSIWYG Editor for You
Stars: ✭ 947 (+1146.05%)
Mutual labels:  wysiwyg-editor
Ngx Kit
DEPRECATED. Some services moved to separated projects: https://github.com/navix/sx-icon, https://github.com/navix/sx-state, https://github.com/navix/sx-focus-listener, https://github.com/navix/sx-class. For other features use @angular/cdk or native HTML/JS.
Stars: ✭ 45 (-40.79%)
Mutual labels:  angular6
Vue Mobiledoc Editor
A lightweight and customizable editor that allows you to embed rich content using Vuejs components.
Stars: ✭ 73 (-3.95%)
Mutual labels:  wysiwyg-editor
React Page
Next-gen, highly customizable content editor for the browser - based on React and written in TypeScript. WYSIWYG on steroids.
Stars: ✭ 8,704 (+11352.63%)
Mutual labels:  wysiwyg-editor

NgxSummernote

Summernote editor for Angular 😎

Installation

Install ngx-summernote and dependencies:

npm install --save ngx-summernote summernote jquery

Compatibility:

Angular ngx-summernote
10 0.8.x
9 0.7.x
8 0.7.x
7 0.6.x
6 0.5.4

Editor

Add JQuery and Summernote scripts and styles to the angular.json file:

"styles": [
  ...
  "node_modules/summernote/dist/summernote-lite.min.css"
],
"scripts": [
  ...
  "node_modules/jquery/dist/jquery.min.js",
  "node_modules/summernote/dist/summernote-lite.min.js"
]

Add NgxSummernoteModule to the app.module.ts file OR to the subcomponent module.ts file if using lazy loading:

...
import { NgxSummernoteModule } from 'ngx-summernote';
...
@NgModule({
...
  imports: [
    ...
    NgxSummernoteModule
    ...
  ]
})
export class AppModule { }

Use [ngxSummernote] directive on an element to init Summernote editor:

<div [ngxSummernote]></div>

You may also configure Summernote with your own config:

<div [ngxSummernote]="config"></div>
export class AppComponent implements OnInit {
  ...
  config = {
    placeholder: '',
    tabsize: 2,
    height: '200px',
    uploadImagePath: '/api/upload',
    toolbar: [
        ['misc', ['codeview', 'undo', 'redo']],
        ['style', ['bold', 'italic', 'underline', 'clear']],
        ['font', ['bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'clear']],
        ['fontsize', ['fontname', 'fontsize', 'color']],
        ['para', ['style', 'ul', 'ol', 'paragraph', 'height']],
        ['insert', ['table', 'picture', 'link', 'video', 'hr']]
    ],
    fontNames: ['Helvetica', 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New', 'Roboto', 'Times']
  }
  ...
}

See Summernote available initialization options here.

Viewer

Use [ngxSummernoteView] directive on an element to set innerHTML of an element:

<div [ngxSummernoteView]="content"></div>

Upload images to server

If you want to upload images to server and use remote paths in editor, you need to set uploadImagePath option in config:

config = {
  uploadImagePath: 'http://example.com/upload' // API URL to upload image
};

API call response is expected to be like:

{
  path: 'the path of the image' // http://example.com/image-path.png
}

If the reponse does not follow the above structure then the image is inserted as data URL.

To remove images from server when deleted from HTML, use (mediaDelete):

<div [ngxSummernote] (mediaDelete)="onDelete($event)"></div>
onDelete(file) {
  deleteResource(file.url);
}

Add custom button

In your component setup summernote config and code for the custom button, e.g.:

function customButton(context) {
  const ui = $.summernote.ui;
  const button = ui.button({
    contents: '<i class="note-icon-magic"></i> Hello',
    tooltip: 'Custom button',
    container: '.note-editor',
    className: 'note-btn',
    click: function() {
      context.invoke('editor.insertText', 'Hello from test btn!!!');
    }
  });
  return button.render();
}

export class AppComponent implements OnInit {
  config: any = {
    ...
    buttons: {
      'testBtn': customButton
    }
  };
  ...
}

See detailed info on custom buttons here.

Development

To use the test application, first build the lib:

ng build ngx-summernote

Then serve the test application and open it in your browser:

npm start

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].