I have a very strange behavior If I change from debug to release mode in Visual Studio.
I have a resource file, which calls a UmbracoAuthorizedJsonController. This Controller give me as response a object with informations about all document types via ContentTypeService.
It works great in debug mode. But if i change to release mode the angularJS object from my response is empty.
This is the result in debug mode:
[{"id":0,"alias":"0","name":"[Choose a document type]"},{"id":1878,"alias":"AboutUs","name":"About us"},{"id":1879,"alias":"Contact","name":"Contact"},{"id":1877,"alias":"Faq","name":"FAQ"},{"id":1876,"alias":"FaqArea","name":"FAQ Area"},{"id":1872,"alias":"Homepage","name":"Homepage"},{"id":1342,"alias":"mail2cms_autodatefolders","name":"mail2cms_AutoDateFolders"},{"id":2168,"alias":"mail2cms_email","name":"mail2cms_email"},{"id":1345,"alias":"mail2cmsDayFolder","name":"mail2cmsDayFolder"},{"id":1344,"alias":"mail2cmsMonthFolder","name":"mail2cmsMonthFolder"},{"id":1343,"alias":"mail2cmsYearFolder","name":"mail2cmsYearFolder"},{"id":1871,"alias":"Master","name":"Master"},{"id":1875,"alias":"News","name":"News"},{"id":1874,"alias":"NewsCategory","name":"News Category"},{"id":1882,"alias":"parserErrors","name":"Parser Errors"},{"id":1881,"alias":"Product","name":"Product"},{"id":1880,"alias":"Products","name":"Products"}]
Ok, I found the error. The behavior came not from the resource file, but from UmbracoAuthorizedJsonController. The result of the method in controller was of type object. Now I have defined a concrete class instead of 'object' and use these and all works good in release mode.
Although I am still not entirely clear why this with objects only in debug mode works, but this was at least the cause.
AngularJS Object is empty in release mode
Hi,
I have a very strange behavior If I change from debug to release mode in Visual Studio.
I have a resource file, which calls a UmbracoAuthorizedJsonController. This Controller give me as response a object with informations about all document types via ContentTypeService.
It works great in debug mode. But if i change to release mode the angularJS object from my response is empty.
This is the result in debug mode:
But this is the result in release mode:
This is my code in angularJS resource file:
Have anyone an explanation for this behavior or a solution for this?
Best,
Sören
Ok, I found the error. The behavior came not from the resource file, but from UmbracoAuthorizedJsonController. The result of the method in controller was of type object. Now I have defined a concrete class instead of 'object' and use these and all works good in release mode.
Although I am still not entirely clear why this with objects only in debug mode works, but this was at least the cause.
Sören
is working on a reply...