[Solved] Object paths in javascript


So, in ASP.NET Boilerplate there are services that we use in controllers. This services can be used in JavaScript file such as

var _tenantService = abp.services.app.tenant;

In view (cshtml) when we click on submit button, form is being sent to app services.

_$form.find('button[type="submit"]').click(function (e) {
    e.preventDefault();

    if (!_$form.valid()) {
        return;
    }

    var tenant = _$form.serializeFormToObject();
    abp.ui.setBusy(_$modal);
    _tenantService.create(tenant).done(function () {
        _$modal.modal('hide');
        location.reload(true); //reload page to see new tenant!
    }).always(function () {
        abp.ui.clearBusy(_$modal);
    });
});

And if we want to add new services or add new methods to services, we have to use camel notation in javascript files. Otherwise it says undefined. For example: I created a method named “NewCreate”. I had to call it like “newCreate”.

But I still don’t know how Javascript accesses to “abp.services.app.tenant;”

0

solved Object paths in javascript