angular model for the "contenteditable" attribute
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
Chakib Benziane 7571d66905 fixes #34 5 years ago
test simpler karma usage (there are no unit tests) 6 years ago
util in post-commit hook first remove all examples 7 years ago
.bowerrc removes jQuery as prerequisite: 7 years ago
.editorconfig Initial commit 7 years ago
.gitattributes Initial commit 7 years ago
.gitignore only use coffeescript for configuration and in tests 7 years ago
.jshintrc Initial commit 7 years ago
.travis.yml Travis-CI 7 years ago
Gruntfile.coffee simpler karma usage (there are no unit tests) 6 years ago
LICENSE added License 6 years ago
README.md use shields.io images 6 years ago
angular-contenteditable-scenario.js add a scenario dsl extension (mostly copied from the standard angular scenario dsl) 7 years ago
angular-contenteditable.js fixes #34 5 years ago
bower.json 0.3.7 6 years ago
karma.coffee simpler karma usage (there are no unit tests) 6 years ago
package.json 0.3.7 6 years ago

README.md

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