Thanks for your help Sander!!!!!, it works :D


On Friday, February 20, 2015 at 12:13:30 AM UTC-6, Sander Elias wrote:
>
> Hi Gustavo,
>
> As you are not using an angular method to fetch your file, you need to 
> tell angualr there is something to do. This is where $scope.$apply comes in.
>
> $scope.parseJSONFile = function() {
> var fs = require('fs');
> var file = $scope.filePath;
> fs.readFile(file, 'utf8', function (err, data) {
> try {
>                               $scope.$apply(function () {
> $scope.jsonParsed = JSON.parse(data.toString()); 
> console.log(data.toString());
>                               });
> }
> catch(err) {
> alert("Invalid file, please verify file structure");
> }
> });
> };
>
> Does that help you?
> Regards
> Sander
>

-- 
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.

Reply via email to