Where do you want modify your data, in your JSON file?
Le mardi 2 juin 2015 23:35:28 UTC+2, Eallan Wong a écrit :
>
> I have a similar question.
> After get data from Json file, how to modify that data? I find that I
> couldn't modify the data.
>
> Eallan
>
>
> On Monday, October 29, 2012 at 9:52:02 AM UTC-4, Marit Rødevand wrote:
>>
>> Hi,
>> I am very new to Angular and Web development.
>>
>> I'm using http get on a json file in a controller, but I am unable to
>> extract any information stored in the json file in the controller.
>> It works perfectly fine to dislpay the information in the json file in a
>> view, but I am unable to retrieve them in the controller to use them in
>> functions.
>> If I try to do console.log in the controller all i get is 'undefined'.
>>
>> e.g:
>>
>> $http.get('users/users.json').success(function(data) {
>> $scope.users = data;
>>
>> console.log($scope.users.username);
>>
>>
>>
>> Is it impossible to use the information in the json file in the
>> controller?
>>
>> If it is possible how do I get the information?
>>
>> Thanks in advance,
>> Have a nice day!
>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.