How to avoid AngularJS to parse string which is not JSON? -


i using angularjs , working static text files data. used factory return $resource as,

app.factory('timeseriesdata', function ($resource) {     return $resource('data/timeseriesdata.txt');  }); 

i tried $http angularjs trying parse json using function in angular.js

function fromjson(json) {   return isstring(json)       ? json.parse(json)       : json; } 

i have plain text data in text file not in json format. parsing causing error in console. how avoid angularjs stop parsing json ?


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -