I´m using sammy.js with a ASP.NET MVC Backend. I have a route that loks like this:
this.get("#/member/inbox", function (context) {
this.load('CurrentUser/Messages')
.then(function (items) {
$.each(items, function (i, item) {
context.log(item.Subject, '-', item.Text);
});
});
But item.Subject and item.Text is undefined. My json looks like this:
[{"Text":"Lorem ipsum","Created":"\/Date(1343375945089)\/","Subject":"test"},{"Text":"testext","Created":"\/Date(1343375945089)\/","Subject":"test2"}]
If I exchange this-load with a call to $.get it works but I want to do this “the sammy way”
Any ideas?
I have the same issue. I’ve found that sammy will load a local file saved as .json correctly. But anything that is called from http will not work even with (“Content-type”, “application/json”)
You can test your own set-up by copy/pasting your own api json feed into a file.
Then see if sammy is able to load it correctly.