I'm working on an editor page. I receive a Json from my server, that contains:
{
"Q_id": 1,
"isMultipuleAns": 0,
"Q_mediaType": "page"
}
And I'm trying to put the information in input div (type=text) or textarea div.
<textarea
type="text"
name="question_title"
ng-model="question.question_title"
ng-init="question.question_title=index"`>
and in my controller I have something like this:
app.controller("someController",function($scope,$location,$http){
// some http requests that puts the mentioned jason in $scope.myJson
$scope.index= $scope.myJson.Q_id;
}
And no matter what I try, ng-init only works with a static string. I can't get the real ID to appear on the site. Only gets a blank input field.
I am new to html and or angular... help?