AlloyEditor directive for Angular.
bower install --save angular-alloyeditor
npm install --save angular-alloyeditor
HTML:
<!-- Load files. -->
<script src="angular/angular.min.js"></script>
<script src="alloyeditor/dist/alloy-editor/alloy-editor-all-min.js"></script>
<script src="angular-alloyeditor.js"></script>
<div ng-controller="MyController">
<alloy-editor id="myEditor" name="myEditor" ng-model="model.content"></alloy-editor>
</div>
JavaScript:
angular
.module('app', ['alloyeditor'])
.controller('MyController', MyController);
function MyController() {
var vm = this;
vm.model = {
content: '<h1>AlloyEditor</h1><p>Yes, you can edit this content. <strong>Right here and right now</strong>.</p>'
};
}
- ng-model: binding the view into the model.
- readonly: is a property that it allows you enable or disable editor.
- onready: call this function after create instance of the editor.
- config: allows you to configure the editor in the way you prefer.
The angular-alloyeditor
project is under MIT license.