Skip to content

Use ngModel and validations with contenteditable HTML5 attribute

License

Notifications You must be signed in to change notification settings

FabricioFFC/ng-contenteditable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng-content-editable

Getting Started

Download the package, and include the dist/content-editable.min.js file in your page.

Via bower

bower install ng-content-editable --save

Or via npm

npm install ng-content-editable --save

Then add the content-editable module to your Angular App file, e.g.

var app = angular.module('app', ["content-editable"]);

Usage

<div
  contenteditable
  ng-model="model"
  ng-maxlength=255
  ng-minlength=3
  only-text="true"
  convert-new-lines="true"
/></div>

Description of optional attributes

Attribute Description Example
ng-maxlength The max-length for the attribute 255
ng-minlength The min-length for the attribute 3
only-text Remove all the html tags for the attribute value true or false
convert-new-lines Convert all <br> and <div> to \r\n true or false

Demo

Visit vizir.github.io/ng-contenteditable

About

Use ngModel and validations with contenteditable HTML5 attribute

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%