1.0.0 • Published 9 years ago
text-editable v1.0.0
#Angular Text Editable Directive
This repo consists of an angularJs directive which is used to edit the text.
Install
You can install this package using bower.
bower install text-editable
Then add a <script>
tag to your index.html
file
<script src="bower_components/text-editable-directive/script.js"></script>
Inject Module Dependency
Inject directive.editable
module
var app = angular.module("myApp", ["directive.editable"]);
Dependencies
How to use
- To use this directive add
editable
tag.
<editable text="label" id="name" save="save(editedText)" model="name" >{{name}}</editable>
- Add the required label to the text attribute, model attribute reflects the ng-model of angular.
- Use the save method in controller to call the back-end API to save text. In the
editedText
you will get the modified text which can be saved using backend API.
$scope.save = function(editedText){
// Backend Save API
console.log(editedText);
}
Demo
Demo Plunkr
1.0.0
9 years ago