0

my todo.json file:

[{"action":"Buy Flowers", "done":false},
{"action":"Get Shoes", "done":false},
{"action":"Collect Tickets", "done":true},
{"action":"Call Joe", "done":false}]

My Script:

 var model = {user: "Adam"};
    var todoApp = angular.module("todoApp",[]);
    todoApp.run(function($http){
        $http.get("todo.json").success(function(data){
            model.items = data;
        });
    });

When I open developer console in Edge I am getting the following error:

SCRIPT438: Object doesn't support property or method 'success' todo.html (11,12)

My JSON, HTML/Script file are all in the same directory.

GlobalJim
  • 1,149
  • 2
  • 16
  • 24
  • Probably related: https://stackoverflow.com/questions/35329384/why-are-angular-http-success-error-methods-deprecated-removed-from-v1-6 But that's not exactly clear, since you haven't mentioned the version of angular in use here. – Claies May 19 '18 at 23:05
  • AngularJS v1.6.9 – GlobalJim May 20 '18 at 22:31
  • so then definitely the article I linked (and was marked as duplicate) is the correct answer. – Claies May 21 '18 at 00:35

0 Answers0