Open Closed

How can we prevent an API/Controller/Service to not generate as service in Angular application? #7033


User avatar
0
sandeep.step2gen@gmail.com created
  • ABP Framework version: v7.3.2

  • UI Type: Angular

  • Database System: EF Core (SQL Server)

  • Tiered (for MVC) or Auth Server Separated (for Angular): no

How can we prevent an API/Controller/Service to not generate as service in Angular application when run abp generate-proxy -t ng ?


11 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    CLI will generate a proxy script with the module name app by default.

    You can use different module name for your API to avoid generating proxies:

    [RemoteService(Name = "myapp")]
    [Area("myapp")]
    [Route("api/test")]
    public class TestController : AbpControllerBase, ITestAppService
    {
      ....
    }
    
  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    No, I want to ignore only one particular API, like this method I want to be avoid
    image.png

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Unfortunately, there is currently no way to ignore it. you may need to delete it manually

  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    then we need to do that every time, right?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Yes, it will be a bit troublesome

    I suggest you move the method to a new API controller and use different module name

  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    btw about the proxy now we are getting this issue, after adding IRemoteStreamContent in the Dto

    image.png
    image.png
    image.png
    image.png

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    The problem should be fixed in the next CLI version.

    image.png

  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    So also we can not use IFormFile, is that right?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    yes, You should use IRemoteStreamContent

  • User Avatar
    0
    sandeep.step2gen@gmail.com created

    then How can we call this API with POSTMAN?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    It's no different than IFormFileimage.png

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 13, 2025, 04:08