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

Activities of "carelearning"

Question

Since Angular2 just recently went to beta, we thought we would try to move in that direction. Has any thought or effort been put into using Angular2 within Asp.Net Zero? We have been reading about ngUpgrade: <a class="postlink" href="http://blog.thoughtram.io/angular/2015/10/24/upgrading-apps-to-angular-2-using-ngupgrade.html">http://blog.thoughtram.io/angular/2015/ ... grade.html</a> Has anybody else tried to do anything like this?

Question

Hello,

We have a need to have the left navigation bar render differently based on features and permissions per tenant. For example we added this to AppNavigationProvider.cs,

if (_featureChecker.IsEnabled(IndividualConstants.FeatureName)) {
	context.Manager.MainMenu.AddItem(new MenuItemDefinition(
    	PageNames.App.Tenant.Individual,
    	L("Tenants"),
    	url: "tenant.individual",
    	icon: "icon-users"));
}

However, we receive the following error: FeatureChecker can not get a feature value by name. TenantId is not set in the IAbpSession!

Is there a way to dynamically generate navigation based on features and permissions? We were thinking about declaring the menu items in the client. Do you have any advice or know of any pitfalls?

careLearning-Bill

Following the guidelines from module system we have incorporated several of the providers in the module including Localization. See code below.

public class IndividualModule : AbpModule
    {
        public override void PreInitialize()
        {
            Configuration.Authorization.Providers.Add<IndividualAuthorizationProvider>();
            Configuration.Features.Providers.Add<IndividualFeature>();

            Configuration.Localization.Languages.Add(
                new LanguageInfo("en", "English", "famfamfam-flag-us", true));

            Configuration.Localization.Sources.Add(
                   new DictionaryBasedLocalizationSource(
                       Constants.LocalizationSourceName,
                       new XmlEmbeddedFileLocalizationDictionaryProvider(
                           Assembly.GetExecutingAssembly(),
                           Constants.ResourceSource)
                       )
                   );

            Configuration.Navigation.Providers.Add<IndividualNavigationProvider>();
            base.PreInitialize();
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
        }
    }

The question arises when using @L("Individual") in our Razor CSHTML for the AngularJS view it is using the base LocalizationSourceName value . We need to reference the base localization dictionary and that specific module's version too in the same view.

To illustrate createPersonModal.cshtml the first usage line #6 I'd like to say something like @L("CreateNewPerson", "Individual") where the second parameter is the module's dictionary. In contrast line #28 @L("SavingWithThreeDot") remains the same as it needs to reference the base localization dictionary defined in Core.

PS ASP.NET Zero is an awesome Starter Template/Framework and the code is of high quality.

Showing 41 to 43 of 43 entries