Base solution for your next web application
Open Closed

Access ICustomConfigProvider data from Angular #10045


User avatar
0
ignasiclos created

Hello,

I've created a new section in the configuration, so I've added a new CustomConfigProvider to the core module :

Configuration.CustomConfigProviders.Add(new MenuConfigProvider());

I've checked that is correctly added to the configuration.

The think is that I don't know how to consume it in the angular application.

Thanks

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

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

    Hi,

    You should be able to access it using abp.custom on the Angular side. Before writing any code, you can write abp.custom to browser console and see it your custom config is accessible.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ignasiclos created

    It works in the console, but I got an error when compiling :

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can modify typings.d.ts as below;

    declare namespace abp {
        namespace ui {
            function setBusy(elm?: any, text?: any, optionsOrPromise?: any): void;
        }
        
        namespace custom { }
    }
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ignasiclos created

    Is not working, still the same problem. I made it work with a cast (<any>abp).custom. but I'd like to fix it

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you create an issue on https://github.com/aspnetzero/aspnet-zero-core/issues ? We will fix it.

    Thanks,

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)