Aspnetboilerplate: Create a Controller returns Abp scripts as data

Created on 17 Oct 2016  路  3Comments  路  Source: aspnetboilerplate/aspnetboilerplate

/AbpScriptsController/GetScripts returns a javascript file that sets abp.localization, abp.settings... etc. While this is fine for most cases, we should also provide all these as plain JSON data. That will be better for mobile and SPAs.

feature

Most helpful comment

That's good. But such an API can also be used by a mobile application (where there is no javascript).

All 3 comments

it would be nice, but there is a simple work around to achieve the same result.
instead of putting /AbpScriptsController/GetScripts as a script reference in html, i call it with a Ajax Get Request, and in request success i eval the returned script text and it gets converted to objects :)
var scriptsObject = eval(scriptsString);

That's good. But such an API can also be used by a mobile application (where there is no javascript).

how to use the new controller, when i call it it returns ?
Abp.Web.Models.AbpUserConfiguration.AbpUserConfigurationDto

Was this page helpful?
0 / 5 - 0 ratings