1

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?

Console output showing before and after

I've tried to replicate in a JSFiddle, but it doesn't give me the same result, it seems to work fine:

https://jsfiddle.net/kmturley/709uc3x8/2/

    0

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.