Base solution for your next web application
Open Closed

Tenant name in Javascript #9379


User avatar
1
admin@SYNTAQ created

Him,

How do you get the Tenant Name in javascript?

Cheers


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

    hi

    You can try:

    For mvc
    var tenancyName = app.session.tenant ? app.session.tenant.tenancyName : null;
    
    For angular
    injector AppSessionService
    
  • User Avatar
    0
    admin@SYNTAQ created

    Thanks,

    My app.session object is undefined. I am logged on and running .net Core MVC ASPNET ZERO 8.8

  • User Avatar
    0
    admin@SYNTAQ created

    FYI also - logged on as a tenant

  • User Avatar
    1
    maliming created
    Support Team

    hi

    The code of appSession exists in wwwroot/Common/Scripts/appSession.js.

    var app = app || {};
    (function () {
        abp.services.app.session.getCurrentLoginInformations({ async: false })
        .done(function (result) {
            app.session = result;
        });
    })();
    
  • User Avatar
    0
    ashgadala created

    Thank you