I have successfully added a custom WebApi controller in the WebApiModule, but how can I get ABP to generate the Dynamic JavaScript Proxy for these custom WebApi controllers?
If I can not, does that means I will have to hardcode the URL in the AngularJs side to consume these controllers?
3 Answer(s)
-
0
Yes, automatic javascript proxies usable just for dynamic web api layer currently. This feature is in the road map: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/94">https://github.com/aspnetboilerplate/as ... /issues/94</a>
-
0
Hi Halil,
I would like to take a stab at the problem but I need some information on how the JavaScript proxies are being generated by the framework at the moment. However, I could not find the info from ABP documentations. Will you be kind enough to explain briefly about this process?
Thank you!
-
0
Hi,
It's not in documents since it's internal implementation of ABP. But since ABP is open source, you can get codes and see it. This class (<a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp.Web.Api/WebApi/Controllers/Dynamic/Scripting/ServiceProxiesController.cs">https://github.com/aspnetboilerplate/as ... troller.cs</a>) can be a starting point to follow. For example <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp.Web.Api/WebApi/Controllers/Dynamic/Scripting/Angular/AngularActionScriptWriter.cs">https://github.com/aspnetboilerplate/as ... tWriter.cs</a> creates a method for angularjs.
Briefly, it dynamically creates javascript. You can do it for a regular web api controller by reflection.