Open Closed

Angular setting configuration requires one argument where as document suggests no argument required #5825


User avatar
0
smansuri created
  • ABP Framework version: v7.3
  • UI Type: Angular
  • Database System: EF Core MySQL
  • Tiered (for MVC) or Auth Server Separated (for Angular): Auth server separated angular
  • Exception message and full stack trace: requires one argument
  • Steps to reproduce the issue: follow the link https://docs.abp.io/en/abp/latest/UI/Angular/Config-State-Service

In the article , https://docs.abp.io/en/abp/latest/UI/Angular/Config-State-Service it says to set the config state service call this.abpApplicationConfigurationService.get().subscribe(config => { this.config.setState(config); }) while trying the above code inside constructor it is expecting one argumet in the get function. please provide what info and how to pass.


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

    Hello smansuri,

    please have look to this https://support.abp.io/QA/Questions/4652/The-attribute-setState-does-not-exist-on-the-type-ConfigStateService

    please try this code

    import { ApplicationConfigurationRequestOptions, } from '@abp/ng.core';
    
    const param: ApplicationConfigurationRequestOptions = {
          includeLocalizationResources: false // ApplicationConfigurationRequestOptions is having only this flag which we can set true or false
    }; // this is parameter which we are passing in get method
    
    this.abpApplicationConfigurationService.get(param).subscribe(config => {
          this.config.setState(config);
    })
    

    please do let me know if find helpful for you or anything else needed

    Thank you, Anjali

  • User Avatar
    0
    smansuri created

    const param: ApplicationConfigurationRequestOptions = { includeLocalizationResources: false // ApplicationConfigurationRequestOptions is having only this flag which we can set true or false }; // this is parameter which we are passing in get method

    we are trying to get settings data before login. after your suggested code also the below line of code some times return the sitekey and sometime does not. this.config.getSetting("Abp.Account.Captcha.SiteKey")

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello smansuri Please check below link for Captcha site key https://support.abp.io/QA/Questions/489/How-to-enable-reCaptcha-in-ABP

    I have added site key and whenever I am trying to fetch that with this.config.getSetting("Abp.Account.Captcha.SiteKey") I am getting this key only on logout screen as well

  • User Avatar
    0
    smansuri created

    Did you try on home/landing page not login page. or anyother page with does nt require authentication. even if i call the api https://doctrz.in:44325/api/abp/application-configuration i get below response in settings property without captcha key. "setting": { "values": { "Abp.Localization.DefaultLanguage": "en", "Abp.Timing.TimeZone": "UTC", "Abp.Identity.TwoFactor.Behaviour": "Optional", "Abp.Identity.TwoFactor.UsersCanChange": "True", "Abp.Account.EnableLdapLogin": "false", "Abp.Identity.EnableOAuthLogin": "false", "Abp.Identity.OAuthLogin.Authority": null, "Abp.Identity.OAuthLogin.ClientId": null, "Abp.Identity.OAuthLogin.ClientSecret": null, "Abp.Identity.OAuthLogin.Scope": null, "Abp.Identity.OAuthLogin.RequireHttpsMetadata": "false", "Abp.Identity.OAuthLogin.ValidateEndpoints": "false", "Abp.Identity.OAuthLogin.ValidateIssuerName": "false" } },

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello smansuri without login. I am getting these values { "values": { "Abp.Localization.DefaultLanguage": "en", "Abp.Timing.TimeZone": "UTC", "Abp.Identity.Password.RequiredLength": "6", "Abp.Identity.Password.RequiredUniqueChars": "1", "Abp.Identity.Password.RequireNonAlphanumeric": "True", "Abp.Identity.Password.RequireLowercase": "True", "Abp.Identity.Password.RequireUppercase": "True", "Abp.Identity.Password.RequireDigit": "True", "Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword": "False", "Abp.Identity.Password.PasswordChangePeriodDays": "0", "Abp.Identity.Lockout.AllowedForNewUsers": "True", "Abp.Identity.Lockout.LockoutDuration": "300", "Abp.Identity.Lockout.MaxFailedAccessAttempts": "5", "Abp.Identity.SignIn.RequireConfirmedEmail": "False", "Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "True", "Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "False", "Abp.Identity.User.IsUserNameUpdateEnabled": "True", "Abp.Identity.User.IsEmailUpdateEnabled": "True", "Abp.Identity.OrganizationUnit.MaxUserMembershipCount": "2147483647", "Abp.Identity.TwoFactor.Behaviour": "Optional", "Abp.Identity.TwoFactor.UsersCanChange": "True", "Abp.Account.EnableLdapLogin": "false", "Abp.Identity.EnableOAuthLogin": "false", "Abp.Identity.OAuthLogin.Authority": null, "Abp.Identity.OAuthLogin.ClientId": null, "Abp.Identity.OAuthLogin.ClientSecret": null, "Abp.Identity.OAuthLogin.Scope": null, "Abp.Identity.OAuthLogin.RequireHttpsMetadata": "false", "Abp.Identity.OAuthLogin.ValidateEndpoints": "false", "Abp.Identity.OAuthLogin.ValidateIssuerName": "false", "Abp.Account.IsSelfRegistrationEnabled": "true", "Abp.Account.EnableLocalLogin": "true", "Abp.Account.TwoFactorLogin.IsRememberBrowserEnabled": "true", "Abp.Account.Captcha.UseCaptchaOnLogin": "False", "Abp.Account.Captcha.UseCaptchaOnRegistration": "False", "Abp.Account.Captcha.VerifyBaseUrl": "https://www.google.com/", "Abp.Account.Captcha.SiteKey": "Test", "Abp.Account.Captcha.Version": "3", "Abp.Account.Captcha.Score": "0.5", "Abp.Account.ProfilePictureSource": "False" } } If you are not getting the proper response can you please try to update framework. Can you please elaborate what issue you are facing now?

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15