Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Angular controller can not call application service #48


User avatar
0
dinhienhy created

Hi,

Angular controller can not call application service. Please review bellow code:

Angular controller:

angular.module('app').controller(controllerId, [
        'abp.services.app.log4net',
        function (log4netService) {
            var vm = this;
}])

My application service:

public class Log4NetService : ApplicationService, ILog4NetService
    {
.....
}

Chrome console throw an error (please review attachment picture):

Do i have any mistake about convention code?


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

    I think it should be 'abp.services.app.log4Net' instead of 'abp.services.app.log4net'.

    For such cases, you can check auto-generated proxy:

    <a class="postlink" href="http://your-url/">http://your-url/</a>api/AbpServiceProxies/GetAll?type=angular

  • User Avatar
    0
    dinhienhy created

    Thanks for your support. It worked!

  • User Avatar
    0
    g.adolph created

    The best way to find which name of your service is access url /api/AbpServiceProxies/GetAll?type=angular you will find all services.