1.0.0 • Published 9 years ago

text-editable v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

#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

  1. AngularJs library
  2. Twitter Boostrap

How to use

  1. To use this directive add editable tag.
<editable text="label" id="name" save="save(editedText)" model="name" >{{name}}</editable>
  1. Add the required label to the text attribute, model attribute reflects the ng-model of angular.
  2. 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