Base solution for your next web application
Open Closed

Problem with Replacing Angular JS #1052


User avatar
0
maharatha created

Hi Hilkan -

I am moving the UI from Angular JS to Ext JS and facing an issue.

When I write Abp.Session in my console I am getting all the properties liek UserID and TenantID

But when I write Abp.services.app it's not getting any properties. I am guessing I am missing some script files to include in my ExtJS screen.

Everything works fine when I am using Angular JS

Could you please help on how i move the code from Angular JS to some other UI without breaking or losing anything.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You need to implement IScriptProxyGenerator for ExtJS in order ExtJs ajax calls to work with dynamic web api services. Then you need to use your custom ExtJSProxyGenerator class instead of AngularProxyGenerator.

    You can inspire from current angular proxy generator <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/62ef9634e5847c2cef42784619fdec545fb0d64c/src/Abp.Web.Api/WebApi/Controllers/Dynamic/Scripting/Angular/AngularProxyGenerator.cs">https://github.com/aspnetboilerplate/as ... nerator.cs</a>.

    I hope this helps.

  • User Avatar
    0
    maharatha created

    Thank you so much. But as I am not sure how to write it for ExtJS so probably have to wait for someone to help me out

  • User Avatar
    0
    hikalkan created
    Support Team

    As I understand, you want to call application services from javascript code. If so, you can directly use like

    abp.services.app.yourService.yourMethod(...)...
    

    This line (<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/App/common/views/layout/layout.cshtml#L94">https://github.com/aspnetzero/aspnet-ze ... cshtml#L94</a>) includes jQuery style service proxies. Then you can use like above. We did it like that for Multi-Page Application side.