angular model for the "contenteditable" attribute
This repository has been archived on 2020-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Chakib Benziane 7571d66905 fixes #34
2015-01-31 21:20:32 +01:00
test simpler karma usage (there are no unit tests) 2014-06-24 17:03:06 +01:00
util in post-commit hook first remove all examples 2013-10-16 05:35:00 +01:00
.bowerrc removes jQuery as prerequisite: 2013-10-13 21:02:12 -07:00
.editorconfig Initial commit 2013-06-12 18:35:58 +01:00
.gitattributes Initial commit 2013-06-12 18:35:58 +01:00
.gitignore only use coffeescript for configuration and in tests 2013-07-29 21:48:13 -07:00
.jshintrc Initial commit 2013-06-12 18:35:58 +01:00
.travis.yml Travis-CI 2013-10-15 21:37:46 +01:00
angular-contenteditable-scenario.js add a scenario dsl extension (mostly copied from the standard angular scenario dsl) 2013-08-05 15:03:51 -07:00
angular-contenteditable.js fixes #34 2015-01-31 21:20:32 +01:00
bower.json 0.3.7 2014-06-24 17:28:07 +01:00
Gruntfile.coffee simpler karma usage (there are no unit tests) 2014-06-24 17:03:06 +01:00
karma.coffee simpler karma usage (there are no unit tests) 2014-06-24 17:03:06 +01:00
LICENSE added License 2013-12-06 02:00:32 +00:00
package.json 0.3.7 2014-06-24 17:28:07 +01:00
README.md use shields.io images 2014-06-24 16:29:39 +01:00

angular-contenteditable

Build Status Dependency Status endorse

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"
  }])
<div ng-controller="Ctrl">
  <span contenteditable="true"
        ng-model="model"
        strip-br="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