angular model for the "contenteditable" attribute
You cannot 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.
 
 
Go to file
Dmitri Akatov cc52856cd9 in post-commit hook first remove all examples 11 years ago
test instead of trying to access the scope, change it through an input element (verbatim) 11 years ago
util in post-commit hook first remove all examples 11 years ago
.bowerrc removes jQuery as prerequisite: 11 years ago
.editorconfig Initial commit 11 years ago
.gitattributes Initial commit 11 years ago
.gitignore only use coffeescript for configuration and in tests 11 years ago
.jshintrc Initial commit 11 years ago
.travis.yml Travis-CI 11 years ago
Gruntfile.coffee i don't like semicolons any more 11 years ago
README.md added gemnasium badge 11 years ago
angular-contenteditable-scenario.js add a scenario dsl extension (mostly copied from the standard angular scenario dsl) 11 years ago
angular-contenteditable.js Merge pull request #5 from solidspark/master 11 years ago
bower.json 0.3.5 - don't do anything for contenteditable without an ngModel 11 years ago
package.json updated npm dependencies 11 years ago

README.md

angular-contenteditable

Build Status Dependency Status Bitdeli Badge

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', 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

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 dislay 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