generator-gulp-angular icon indicating copy to clipboard operation
generator-gulp-angular copied to clipboard

json file not found

Open mikiasmohamed opened this issue 9 years ago • 1 comments

I am unable to find data.json when I do a 'gulp serve'. I get a '404 not found ' error. That mainly happens as I try to do the following in my factory: $http.get('data.json') .success(function(data){ defer.resolve(data); }).error(function(err){ defer.reject(err); }) return defer.promise; }

Any solution?

mikiasmohamed avatar Mar 06 '16 13:03 mikiasmohamed

Where is your data.json file? You have to provide the path relative from your src/ folder.

.success and .error are deprecated. Use .then and .catch instead.

piu130 avatar Apr 29 '16 08:04 piu130