I want to two way binding to a text area that will contain json object as text, and I should able to edit the json object in textarea as two way. working demo is here
<div ng-app="app">
<div ng-controller="GeojsonController">
<textarea ng-model="geojson"></textarea>
<p>Geojson is: {{geojson | json}} </p>
</div>
</div>
angular.module('app', [])
.controller('GeojsonController', ['$scope', function($scope) {
$scope.geojson = {
"type": "FeatureCollection"
};
}]);
Text area content is [object Object]
| jsondoing?$scope.geojsonis already a json object, that is why you get[object Object]in your textarea, you are going to have to use$scope.geojsonas a string and then convert the string to json.