Base solution for your next web application

Activities of "cangunaydin"

Ok my bad now i have an access thank you.

Can i also have a github access?

u: cangunaydin email: <a href="mailto:[email protected]">[email protected]</a>

Question

Hello, I want to apply a new custom settings to asp.net core & angular2 application. This will be a json object value all over the application. But i want to change it from appsettings file. My problem is i tried to add this value to appsettings.json file and I can reach the value from mvc application from IHostingEnvironment interface in startup and can reach the whole config file. But how can i reach these values from applicationservice project. I have tried couple of things like SettingManager and ISettingStore but these are custom values that is parsed to a different object from the config file i guess. Can you suggest some solution for it or should i parse this value in AppSettingProvider?

Hello, I have found couple of things in the angular2 ui project. I have just wanted to share it. Inside change-profile-picture-modal.component.html 2 things i realized. First one is saving variable which do not exist in the component.ts and the second thing is hide() function probably it should be close() function.

Actually i was talking about the .html file

<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/c2f52042bd74e1d29674b33f4a75dde944441fd2/angular/src/app/shared/layout/profile/change-profile-picture-modal.component.html">https://github.com/aspnetzero/aspnet-ze ... onent.html</a>

below here you can see that you are calling hide() function which is not in component.ts

<button type="button" class="close" aria-label="Close" (click)="hide()">
          				<span aria-hidden="true">&times;</span>
        			</button>

And when i run the project it doesn't close the modal when i click that. I have the latest version that i have downloaded 2 days ago.

Also saving variable is in .html file, you can see it below.

<button type="button" class="btn default close-button" (click)="close()" [disabled]="saving">{{l("Cancel")}}</button>
					<button type="submit" class="btn blue save-button" [disabled]="!changeProfilePictureModalForm.form.valid || saving"><i class="fa fa-save"></i> <span>{{l("Save")}}</span></button>

but there is no variable called saving in the component.ts.

If it is global or coming from the inherited class i don't know but on click it doesn't close the modal for sure in my app :)

Answer

Thank you, I will try it.

Hello, I have a problem with dependency injection in angular2 project. I have created couple of services in my application project all the appservice classes is implemented from i applicationservice interface and i can see that my methods are working from swagger ui i can do posts or gets to my methods. In the UI project i have run refresh.bat inside nswag folder and it regenerated the methods for me now i can see the components when i import the '@shared/service-proxies/service-proxies' but when i inject them to the constructor of any component. It is giving me an error on runtime. 'No provider for GroupServiceProxy! ; Zone: angular ; Task: Promise.then ; Value:', it feels like it can not inject the http service inside service-proxies but i don't know why. Here is the detailed example below.

GroupAppService:

[AbpAuthorize(AppPermissions.Pages_Tenant_Groups)]
    public class GroupAppService : MagicInfoConfigAppServiceBase, IGroupAppService
    {
        private readonly IRepository<Group> _groupRepository;
        private readonly IAppFolders _appFolders;
        public GroupAppService(IAppFolders appFolders, IRepository<Group> groupRepository)
        {
            _appFolders = appFolders;
            _groupRepository = groupRepository;
        }
        [AbpAuthorize(AppPermissions.Pages_Tenant_Groups_Create)]
        public async Task CreateGroup(CreateGroupInput input)
        {
            var group = input.MapTo<Group>();
            await _groupRepository.InsertAndGetIdAsync(group);
        }

        public async Task<PagedResultDto<GroupListDto>> GetGroups(GetGroupInput input)
        {

            var query = _groupRepository
              .GetAll().Include(g => g.Address)
              .WhereIf(
                  !input.Filter.IsNullOrEmpty(),
                  p => p.Name.Contains(input.Filter) ||
                          p.ServerUrl.Contains(input.Filter) ||
                          p.Address.Name.Contains(input.Filter)
              );
            var groupCount = await query.CountAsync();
            var groups = await query
                .OrderBy(input.Sorting)
                .PageBy(input)
                .ToListAsync();

            var groupListDtos = groups.MapTo<List<GroupListDto>>();

            return new PagedResultDto<GroupListDto>(
                 groupCount,
                 groupListDtos
                 );
        }

        [AbpAuthorize(AppPermissions.Pages_Tenant_Groups_Delete)]
        public async Task DeleteGroup(EntityDto input)
        {
            await _groupRepository.DeleteAsync(input.Id);
        }

      


    }

IGroupAppService:

public interface IGroupAppService : IApplicationService
    {
        Task<PagedResultDto<GroupListDto>> GetGroups(GetGroupInput input);
        Task CreateGroup(CreateGroupInput input);

        Task DeleteGroup(EntityDto input);

    }

and the last thing angular2 component coming as default with asp.net zero. I am trying to inject the groupService inside. Dashboard.component.ts:

import { Component, Injector, AfterViewInit } from '@angular/core';
import { TenantDashboardServiceProxy,GroupServiceProxy } from '@shared/service-proxies/service-proxies';
import { AppComponentBase } from '@shared/common/app-component-base';
import { appModuleAnimation } from '@shared/animations/routerTransition';

@Component({
    templateUrl: './dashboard.component.html',
    animations: [appModuleAnimation()]
})
export class DashboardComponent extends AppComponentBase implements AfterViewInit {

    constructor(
        injector: Injector,
        private _dashboardService: TenantDashboardServiceProxy,
        private _groupService:GroupServiceProxy
    ) {
        super(injector);
    }

    ngAfterViewInit(): void {
        
        Morris.Area({
            element: 'sales_statistics',
            padding: 0,
            behaveLikeLine: false,
            gridEnabled: false,
            //gridLineColor: false,
            axes: false,
            fillOpacity: 1,
            data: [
                {
                    period: '2011 Q1',
                    sales: 1400,
                    profit: 400
                }, {
                    period: '2011 Q2',
                    sales: 1100,
                    profit: 600
                }, {
                    period: '2011 Q3',
                    sales: 1600,
                    profit: 500
                }, {
                    period: '2011 Q4',
                    sales: 1200,
                    profit: 400
                }, {
                    period: '2012 Q1',
                    sales: 1550,
                    profit: 800
                }
            ],
            lineColors: ['#399a8c', '#92e9dc'],
            xkey: 'period',
            ykeys: ['sales', 'profit'],
            labels: ['Sales', 'Profit'],
            pointSize: 0,
            lineWidth: 0,
            hideHover: 'auto',
            resize: true
        });

        this.getMemberActivity();
    }
    test():void{
        this._groupService.deleteGroup(1).subscribe(result=>{
                alert("subscribed");
        });
    }
    getMemberActivity(): void {
        this._dashboardService
            .getMemberActivity()
            .subscribe(result => {
                $("#totalMembersChart").sparkline(result.totalMembers, {
                    type: 'bar',
                    width: '100',
                    barWidth: 6,
                    height: '45',
                    barColor: '#F36A5B',
                    negBarColor: '#e02222',
                    chartRangeMin: 0
                });

                $("#newMembersChart").sparkline(result.newMembers, {
                    type: 'bar',
                    width: '100',
                    barWidth: 6,
                    height: '45',
                    barColor: '#5C9BD1',
                    negBarColor: '#e02222',
                    chartRangeMin: 0
                });
            });
    };
}

Ok sorry for the message i have just missed the part in development guide.

While Nswag automatically generate proxy files, it does not refresh service-proxies.module.ts. If you add a new service, you should manually add it to this file as like others.

so i need to add it there. If someone is having the same problem maybe it can help.

Hello, I am just curious how the ui states in angularjs application can render .cshtml files, partial views? Are there any extension for that? Because as i know it needs to go to the server side to render the html isn't it so?

Oh thank you for the reply. Now it is all clear. I was searching for that.

Question

Hello, I am using Asp.Net Zero Core and Angular2 project. When i built it first time it connects to signalr and there is no problem with the connection. But after rebuilds for both ui and .net core end, sometimes it doesn't connect to signalr hub and gives an 500 internal error for the link <a class="postlink" href="http://localhost:22742/signalr/hubs?=1485624235544">http://localhost:22742/signalr/hubs?=1485624235544</a> from the console of the web browser.

I use VS Code for the ui and VS 2015 for the .net core project. Do you have any idea about what can be the problem?

Showing 11 to 20 of 183 entries