Skip to content
This repository was archived by the owner on Jan 7, 2020. It is now read-only.

Repository files navigation

angular-contenteditable

Build StatusDependency Statusendorse

An AngularJS directive to bind html tags with the contenteditable attribute to models.

Install

bower install angular-contenteditable

Usage

angular.module('myapp',['contenteditable']).controller('Ctrl',['$scope',function($scope){$scope.model="<i>interesting</i> stuff"}])
<divng-controller="Ctrl"><spancontenteditable="true"
ng-model="model"
strip-br="true"
strip-tags="true"
select-non-editable="true"></span></div>

Notice

The directive currently does not work in any version of Internet Explorer or Opera < 15. Both browsers don't fire the input event for contenteditable fields.

In Chrome, when a contenteditable element X contains a non-contenteditable element Y as the last element, then the behaviour of the caret is the following:

  • When X has style display set to block or inline-block, then the caret moves to the very far right edge of X when it is immediately at the end of X (inserting spaces moves the caret back).

  • When X has style display set to inline, then the caret disappears instead.

Development

npm install
bower install
grunt

About

angular model for the "contenteditable" attribute

Resources

Stars

175 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages