Angular: Empty Fiddle

http://angularjs.org/

by ncapito

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<div ng-app='myApp'>
    <div ng-controller="MyCtrl">
        <select ng-model='inputType'>
            <option value='html'>HTML</option>
            <option value='plain'>Plain</option>
            <textarea redactor name='test' ng-model='testValue'></textarea>
        </select>
    </div>
</div>

JavaScript

var myApp = angular.module('myApp', []);

myApp.directive('redactor', function () {
    return {
        require: "?ngModel",
        link: function ($scope, elem, attrs, controller) {
            controller.$render = function () {
                $(elm).val("init")
            };
        }
    };
});
//myApp.factory('myService', function() {});

function MyCtrl($scope) {
    $scope.inputType = 'html';
}