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

Activities of "sampath"

Hi,

I have done as shown below.But it says : duplicate identifier uploader Hope this is my technical issue.Can you tell me how to declare it ? Thanks.

uploader: FileUploader = new FileUploader({
        url: AppConsts.remoteServiceBaseUrl + '/api/DocumentUpload/AddDocument',
        authToken: 'Bearer ' + this._tokenService.getToken()
    });
    
    this.uploader.onAfterAddingFile = (file) => {
        file.withCredentials = false;
    };

Hi

I'm using ABP ng-2 version.

I'm using ng2-file-upload as shown below.But it gives me below error when I tried to upload a image.Web api method is working fine with the Postman.But when I try to use with app it gives below error.Please give me a feedback.Thanks.

Component :

import { Component, Injector } from '@angular/core';
import { TenantDashboardServiceProxy } from '@shared/service-proxies/service-proxies';
import { AppComponentBase } from '@shared/common/app-component-base';
import { appModuleAnimation } from '@shared/animations/routerTransition';
import { FileUploader, FileUploaderOptions, Headers } from 'ng2-file-upload';
import { AppConsts } from '@shared/AppConsts';
import { TokenService } from '@abp/auth/token.service';


@Component({
    templateUrl: './drawings.component.html',
    animations: [appModuleAnimation()]
})

export class DrawingsComponent extends AppComponentBase {

    constructor(injector: Injector, private _tokenService: TokenService) {
        super(injector);
    }
    
    uploader: FileUploader = new FileUploader({
        url: AppConsts.remoteServiceBaseUrl + '/api/DocumentUpload/AddDocument',
        authToken: 'Bearer ' + this._tokenService.getToken()
    });
    
    hasBaseDropZoneOver: boolean = false;
    hasAnotherDropZoneOver: boolean = false;

    fileOverBase(e: any): void {
        this.hasBaseDropZoneOver = e;
    }

    fileOverAnother(e: any): void {
        this.hasAnotherDropZoneOver = e;
    }

}

Error :

XMLHttpRequest cannot load <a class="postlink" href="http://localhost:22742/api/DocumentUpload/AddDocument">http://localhost:22742/api/DocumentUpload/AddDocument</a>. Response to preflight request doesn't pass access control check: Credentials flag is 'true', but the 'Access-Control-Allow-Credentials' header is ''. It must be 'true' to allow credentials. Origin 'http://localhost:4200' is therefore not allowed access. vendor.bundle.js:147481 XHR failed loading: POST "http://localhost:22742/api/DocumentUpload/AddDocument".

Hi ismcagdas,

Awesome ! Thanks a lot.I'll try that and will let you know :)

Hi,

Yes,me too used the link which you have mentioned on the "developing an application step by step" doc.On that link first tab is "fontawsome icons" tab.I have tried to use that classes directly and didn't work.Anyway I have used it as you mentioned and now it is working.Thanks a lot :)

Hi,

Can you tell me how to add an icon to the ng-2 version app ?

I have tried this.But it's not working.It is working fine for the already existing icons such as "icon-home". Can you tell me how to do that ? Thanks.

new SideBarMenuItem("Dashboard", "Pages.Tenant.Dashboard", "check-circle-o", "/dashboard"),

I got icons from here : [http://keenthemes.com/preview/metronic/theme/admin_4_material_design/ui_icons.html])

Hi ismcagdas,

Thanks a lot.Now I can access it :)

Hi ismcagdas,

I don't have permission on Git Repo. Can you please allow me ?

Hi ismcagdas,

Wow ...It is Great news.Thanks a lot.We're awaiting for that :)

Hi mysterio21troy,

Thanks a lot.That was the issue.My cli version was ^1.0.0-beta.24 .Still it's having issues :( I have changed as you mentioned and now it is working fine :)

I would like to ask few questions from you :

  1. Can you tell me about your development environment with latest abp ? Are you using 2 instances of VS 2015 or what ? Using 2 instances of VS has been killed the performance of my machine :(

  2. How you're publishing the app ? We can publish core project to azure.But what about client thing ? Unable to find out the information about these things on the latest abp doc yet.Please provide us your real experience with this.Thanks.

Hi,

When I try to run the client project, it gives below error.Can you tell me why ? Server project is working fine.

Showing 31 to 40 of 187 entries