I am loading a json feed within an AngularJS directive, using the $http method:
$http({ method: 'GET', url: '/api/comments/' }).then(function (res) { console.log(1, JSON.stringify(res.data.results[0])); scope.items = res.data.results; console.log(2, JSON.stringify(scope.items[0])); });
At step one I get:
deliverable: true id: 8100
At step two (after the template compiles) I get:
$$hashKey: "object:84" deliverable: "false" id: 8100
Why is AngularJS casting a boolean as a string, and the wrong string value?
I've tried to replicate in a JSFiddle, but it doesn't give me the same result, it seems to work fine: