Skip to content

Instantly share code, notes, and snippets.

View aissaghouti's full-sized avatar
🏠
Working from home

Aïssa Ghouti aissaghouti

🏠
Working from home
View GitHub Profile
@bettysteger
bettysteger / contenteditableDrct.js
Last active July 13, 2018 13:22
Angular directive to accomplish two-way data binding for contenteditable elements with ng-model
/**
* Two-way data binding for contenteditable elements with ng-model.
* @example
* <p contenteditable="true" ng-model="text"></p>
*/
app.directive('contenteditable', function() {
return {
require: '?ngModel',
link: function(scope, element, attrs, ctrl) {