I want to append a signature with date say "Signature 07/08/2015" inside a textarea on a button click. How can I do this is AngularJS way?
Say textarea contains text as "This is a text". After clicking button it should convert to,
This is a text
Signature 07/08/2015
It's pretty easy to do in JavaScript way, but I am entirely beginner with Angular.
Here is what I have tried to get date in app.js,
$scope.getDate = new Date();
I can use this in view as,
<p ng-bind="getDate | date:'MM/dd/yyyy'"></p>
The textarea seems like this,
<textarea type="text" class="form-control" id="description" name="description" ng-model="description"></textarea>
<a href="javascript:" id="add-signature" onclick="addSignature();">add signature</a> // this needs to be modify in angular way.
Simply in short,
- get textarea value
- append signature
- set this new value in textarea