Socket
Socket
Sign inDemoInstall

angular-weblineindia-ck-editor

Package Overview
Dependencies
8
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    angular-weblineindia-ck-editor

A simple, native and easy-to-use WYSIWYG / Rich Text editor built in AngularJS.


Version published
Weekly downloads
1
Maintainers
1
Install size
1.57 MB
Created
Weekly downloads
 

Readme

Source

AngularJS - CK Editor

A simple, native and easy-to-use WYSIWYG / Rich Text editor built in AngularJS.

Table of contents

  • Demo
  • Getting started
  • API
  • Want to Contribute?
  • Collection of Other Components
  • Changelog
  • Credits
  • License
  • Keywords

Demo

Nov-27-2019 17-26-29

Getting Started

Installation

Install via npm package manager

npm install angular-weblineindia-ck-editor --save

Usage

Import angular-editor module

import { HttpClientModule} from '@angular/common/http';
import { AngularEditorModule } from 'angular-weblineindia-ck-editor';

@NgModule({
  imports: [ HttpClientModule, AngularEditorModule ]
})

Then in HTML

<angular-editor
  [placeholder]="'Enter text here...'"
  [(ngModel)]="htmlContent"
></angular-editor>

or for usage with reactive forms

<angular-editor
  formControlName="htmlContent"
  [config]="editorConfig"
></angular-editor>

if you using more than one editor on same page set id property

<angular-editor
  id="editor1"
  formControlName="htmlContent1"
  [config]="editorConfig"
></angular-editor>
<angular-editor
  id="editor2"
  formControlName="htmlContent2"
  [config]="editorConfig"
></angular-editor>

where

import { AngularEditorConfig } from "@kolkov/angular-editor";

editorConfig: AngularEditorConfig = {
  editable: true,
  spellcheck: true,
  height: "auto",
  minHeight: "0",
  maxHeight: "auto",
  width: "auto",
  minWidth: "0",
  translate: "yes",
  enableToolbar: true,
  showToolbar: true,
  placeholder: "Enter text here...",
  defaultParagraphSeparator: "",
  defaultFontName: "",
  defaultFontSize: "",
  fonts: [
    { class: "arial", name: "Arial" },
    { class: "times-new-roman", name: "Times New Roman" },
    { class: "calibri", name: "Calibri" },
    { class: "comic-sans-ms", name: "Comic Sans MS" }
  ],
  customClasses: [
    {
      name: "quote",
      class: "quote"
    },
    {
      name: "redText",
      class: "redText"
    },
    {
      name: "titleText",
      class: "titleText",
      tag: "h1"
    }
  ],
  uploadUrl: "v1/image",
  uploadWithCredentials: false,
  sanitize: true,
  toolbarPosition: "top",
  toolbarHiddenButtons: [["bold", "italic"], ["fontSize"]]
};

For ngModel to work, you must import FormsModule from @angular/forms, or for formControlName, you must import ReactiveFormsModule from @angular/forms

API

Inputs

InputTypeDefaultRequiredDescription
idstring-noId property when multiple editor used on same page
[config]AngularEditorConfigdefault confignoconfig for the editor
placeholderstring-noSet custom placeholder for input area
tabIndexnumber-noSet Set tabindex on angular-editor

Outputs

OutputDescription
(html)Output html
(viewMode)Fired when switched visual and html source mode
(blur)Fired when editor blur
(focus)Fired when editor focus

Methods

NameDescription
focusFocuses the editor element

Other

NameTypeDescription
AngularEditorConfigconfigurationConfiguration for the AngularEditor component.

Configuration

InputTypeDefaultRequiredDescription
editableboleantruenoSet editing enabled or not
spellcheckboleantruenoSet spellchecking enabled or not
translatestingyesnoSet translating enabled or not
sanitizeboleantruenoSet DOM sanitizing enabled or not
heightstringautonoSet height of the editor
minHeightstring0noSet minimum height of the editor
maxHeightstringautonoSet maximum height of the editor
widthstringautonoSet width of the editor
minWidthstring0noSet minimum width of the editor
enableToolbarboleantruenoSet toolbar enabled or not
showToolbarboleantruenoSet toolbar visible or not
toolbarPositionstringtopnoSet toolbar position top or bottom
placeholderstring-noSet placeholder text
defaultParagraphSeparatorstring-noSet default paragraph separator such as p
defaultFontNamestring-noSet default font such as Comic Sans MS
defaultFontSizestring-noSet default font size such as 1 - 7
uploadUrlstring-noSet image upload endpoint https://api.exapple.com/v1/image/upload
uploadWithCredentialsboleanfalsenoSet passing or not credentials in the image upload call
fontsFont[]-noSet array of available fonts [{name, class},...]
customClassesCustomClass[]-noSet array of available fonts [{name, class, tag},...]
outlineboleantruenoSet outline of the editor if in focus
toolbarHiddenButtonsstring[][]-noSet of the array of button names or elements to hide
toolbarHiddenButtons: [
  [
    "undo",
    "redo",
    "bold",
    "italic",
    "underline",
    "strikeThrough",
    "subscript",
    "superscript",
    "justifyLeft",
    "justifyCenter",
    "justifyRight",
    "justifyFull",
    "indent",
    "outdent",
    "insertUnorderedList",
    "insertOrderedList",
    "heading",
    "fontName"
  ],
  [
    "fontSize",
    "textColor",
    "backgroundColor",
    "customClasses",
    "link",
    "unlink",
    "insertImage",
    "insertVideo",
    "insertHorizontalRule",
    "removeFormat",
    "toggleEditorMode"
  ]
];

Want to Contribute?

  • Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
  • Fork it.
  • Create new branch to contribute your changes.
  • Commit all your changes to your branch.
  • Submit a pull request.

Collection of Components

We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development.


Changelog

Detailed changes for each release are documented in CHANGELOG.md.

Credits

angular-weblineindia-ck-editor is inspired by @kolkov/angular-editor.

License

MIT

Keywords

angular-editor, angular-native-editor, angularjs-wysiwyg, ck-editor, angular-wysiwyg-editor, wysiwyg-editor, angularjs-rich-text-editor, rich-text-editor

Keywords

FAQs

Last updated on 21 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc