contenteditable.js

angular.module('homepage').
directive("contenteditable", function() {
  return {
    restrict: "A",
    require: "ngModel",
    link: function(scope, element, attrs, ngModel) {
      function read() {
        ngModel.$setViewValue(element.html() || "<br>");
      }

      ngModel.$render = function() {
        element.html(ngModel.$viewValue || "<br>");
      };

      element.bind("blur keyup change", function() {
        scope.$apply(read);
      });
    }
  };
});