I have found that I can do this by with the following no problem, until I get to where I also need the to be editable and passed back on save if updated.
Here is a directive that works to add the json data of the current item: (found on SO) - AngularJS: textarea bind to JSON object shows "object-object"
app.directive('jsonText', function() {
return {
restrict: 'A',
require: 'ngModel',
link: function(scope, element, attr, ngModel) {
function into(input) {
return JSON.parse(input);
}
function out(data) {
return JSON.stringify(data);
}
ngModel.$parsers.push(into);
ngModel.$formatters.push(out);
}
};
});
And here is the html, this works for the pre-filling but I am needing the ngModel to also pull in so I can save that data incase of edits.
<textarea json-text ng-model="review" id="review" class="form-control" rows="3" ng-bind="encounterNote"></textarea>
So in the end I need a way to pre-fill a (may be several lines of text from a jSON API), allow that to be edited and then on a save function I have already reference the "current" value to save and updates.