Open Closed

Angular controller can not call application service #48


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? err-app-service.PNG


3 Answer(s)
  • 0
    hikalkan created

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

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

    http://your-url/api/AbpServiceProxies/GetAll?type=angular

  • 0
    dinhienhy created

    Thanks for your support. It worked!

  • 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.