Hi @maliming,
Sorry the file has this opening { , I just missed it when copying.
appconfig.production.json
{
"remoteServiceBaseUrl": "http://localhost:22770",
"appBaseUrl": "http://localhost:4230",
"localeMappings": [
{
"from": "pt-BR",
"to": "pt"
},
{
"from": "zh-CN",
"to": "zh"
},
{
"from": "he-IL",
"to": "he"
}
]
}
Hi ! Can some one give me some guidance to correct this issue ? The App runs fines in developpment and crashes when deployed.
I'm using ASP.NET CORE & Angular V.6.0.0.
From IIS I can start the backend and it runs ok.
But when I launch the app from the browser, here is the error I get this error :
main.6b917b420639c862ad7c.js:1 ERROR SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at XMLHttpRequest.o.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (main.6b917b420639c862ad7c.js:1)
at XMLHttpRequest.E (polyfills.c60318e761d83ed91d05.js:1)
at t.invokeTask (polyfills.c60318e761d83ed91d05.js:1)
at Object.onInvokeTask (main.6b917b420639c862ad7c.js:1)
at t.invokeTask (polyfills.c60318e761d83ed91d05.js:1)
at e.runTask (polyfills.c60318e761d83ed91d05.js:1)
at e.invokeTask [as invoke] (polyfills.c60318e761d83ed91d05.js:1)
at m (polyfills.c60318e761d83ed91d05.js:1)
at XMLHttpRequest.b (polyfills.c60318e761d83ed91d05.js:1)
Appconfig.json :
{
"remoteServiceBaseUrl": "http://localhost:22770",
"appBaseUrl": "http://localhost:4230",
"localeMappings": [
{
"from": "pt-BR",
"to": "pt"
},
{
"from": "zh-CN",
"to": "zh"
},
{
"from": "he-IL",
"to": "he"
}
]
}
appconfig.production.json
"remoteServiceBaseUrl": "http://localhost:22770",
"appBaseUrl": "http://localhost:4230",
"localeMappings": [
{
"from": "pt-BR",
"to": "pt"
},
{
"from": "zh-CN",
"to": "zh"
},
{
"from": "he-IL",
"to": "he"
}
]
}
Thank you, It runs fine now.
I didn't notice the removal of these items
Hi @ryancyq,
Here they are :
AppSettings.json
{
"ConnectionStrings": {
"Default": "Server=localhost; Database=ImmobDb; Trusted_Connection=True;"
},
"AbpZeroLicenseCode": "xxxxxxxxxxxx"
}
AppSettings.production.json
{
"ConnectionStrings": {
"Default": "Server=10.0.75.1; Database=ImmobDb; User=xyza; Password=xxxxx;"
},
"App": {
"WebSiteRootAddress": "http://localhost:9901/",
"ClientRootAddress": "http://localhost:4200/",
"CorsOrigins": "http://localhost:9902"
}
}
Hi ! Can some one give me some guidance to correct this issue ? The App runs fines in developpment and crashes when deployed.
I'm using ASP.NET CORE & Angular V.6.0.0
` Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: value
at System.Boolean.Parse(String value)
at Lbi.Immob.Web.Startup.AuthConfigurer.Configure(IServiceCollection services, IConfiguration configuration)
at Lbi.Immob.Web.Startup.Startup.ConfigureServices(IServiceCollection services) in D:\MyWorkingDir\Immob\aspnet-core\src\Lbi.Immob.Web.Host\Startup\Startup.cs:line 101
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at Lbi.Immob.Web.Startup.Program.Main(String[] args) in D:\MyWorkingDir\Immob\aspnet-core\src\Lbi.Immob.Web.Host\Startup\Program.cs:line 10`
Hi @maharata,
I had this error. It just means that the component (for example AssetFieldLookupTableModalComponent ) is duplicated and the linker is unable to chose one of them.
To solve my problems, I created a folder under "shared" directory where I move one copy of the duplicated components and delete others.
Hope this can you.
Happy new year
Abdourahmani
Hi @ismcagdas ,
I didn't do any manipulation. just using code generated by the RAD tool and data come from database.
Hi, I have the same problem with datepicker.
Dates come from database and are displayed well in p-table. But all are marked "invalid date" in datepicker.
But when I change the default language to "English", some are displayed but have wrong values. Years are correct. But all dates are 01/20/yyyy.
v6.0.0.0 Angular/Asp .net core RAD 1.6.3, but the component must have been genereated with previous version, 2 weeks ago
Thanks.
@alirizaadiyahsi
I finally got what you meant, applied it but it didn't help.
Hi @ismcagdas Please find the javascript code for the modal below.
Regards, Abdourahmani
import { Component, ViewChild, Injector, Output, EventEmitter } from '@angular/core';
import { ModalDirective } from 'ngx-bootstrap';
import {
PaliersServiceProxy,
CreateOrEditPalierDto,
PalierDetailsServiceProxy,
PalierDetailDto
} from '@shared/service-proxies/service-proxies';
import { AppComponentBase } from '@shared/common/app-component-base';
import { TypePalierLookupTableModalComponent } from './typePalier-lookup-table-modal.component';
import { CreateOrEditPalierDetailModalComponent } from '@app/main/remuneration/paliers/create-or-edit-palierDetail-modal.component';
import { DataTable } from 'primeng/components/datatable/datatable';
import { Paginator } from 'primeng/components/paginator/paginator';
import { LazyLoadEvent } from 'primeng/components/common/lazyloadevent';
import { FileDownloadService } from '@shared/utils/file-download.service';
@Component({
selector: 'createOrEditPalierModal',
templateUrl: './create-or-edit-palier-modal.component.html'
})
export class CreateOrEditPalierModalComponent extends AppComponentBase {
@ViewChild('createOrEditModal') modal: ModalDirective;
@ViewChild('typePalierLookupTableModal') typePalierLookupTableModal: TypePalierLookupTableModalComponent;
@ViewChild('createOrEditPalierDetailModal') createOrEditPalierDetailModal: CreateOrEditPalierDetailModalComponent;
@ViewChild('dataTable') dataTable: DataTable;
@ViewChild('paginator') paginator: Paginator;
@Output() modalSave: EventEmitter<any> = new EventEmitter<any>();
active = false;
saving = false;
advancedFiltersAreShown = false;
filterText = '';
maxTauxFilter: number;
maxTauxFilterEmpty: number;
minTauxFilter: number;
minTauxFilterEmpty: number;
palier: CreateOrEditPalierDto = new CreateOrEditPalierDto();
typePalierDescript = '';
constructor(
injector: Injector,
private _paliersServiceProxy: PaliersServiceProxy,
private _palierDetailsServiceProxy: PalierDetailsServiceProxy,
private _fileDownloadService: FileDownloadService
) {
super(injector);
}
show(palierId?: number): void {
if (!palierId) {
this.palier = new CreateOrEditPalierDto();
this.palier.id = palierId;
this.palier.orderBy = '001';
this.typePalierDescript = '';
this.active = true;
this.modal.show();
} else {
this._paliersServiceProxy.getPalierForEdit(palierId).subscribe(result => {
this.palier = result.palier;
this.typePalierDescript = result.typePalierDescript;
this.active = true;
this.modal.show();
});
}
}
savePalier(): void {
this.saving = true;
this._paliersServiceProxy
.createOrEdit(this.palier)
.finally(() => {
this.saving = false;
})
.subscribe(() => {
this.notify.info(this.l('SavedSuccessfully'));
this.close();
this.modalSave.emit(null);
});
}
openSelectTypePalierModal() {
this.typePalierLookupTableModal.id = this.palier.typePalierId;
this.typePalierLookupTableModal.displayName = this.typePalierDescript;
this.typePalierLookupTableModal.show();
}
setTypePalierIdNull() {
this.palier.typePalierId = null;
this.typePalierDescript = '';
}
getNewTypePalierId() {
this.palier.typePalierId = this.typePalierLookupTableModal.id;
this.typePalierDescript = this.typePalierLookupTableModal.displayName;
}
close(): void {
this.active = false;
this.modal.hide();
}
getPalierDetails(event?: LazyLoadEvent) {
this.createOrEditPalierDetailModal.palier = this.palier;
if (this.primengDatatableHelper.shouldResetPaging(event)) {
this.paginator.changePage(0);
return;
}
this.primengDatatableHelper.showLoadingIndicator();
this._palierDetailsServiceProxy
.getAll(
this.filterText,
this.palier.code, // filtre les elements du palier séléctionné
this.maxTauxFilter == null ? this.maxTauxFilterEmpty : this.maxTauxFilter,
this.minTauxFilter == null ? this.minTauxFilterEmpty : this.minTauxFilter,
this.primengDatatableHelper.getSorting(this.dataTable),
this.primengDatatableHelper.getSkipCount(this.paginator, event),
this.primengDatatableHelper.getMaxResultCount(this.paginator, event)
)
.subscribe(result => {
this.primengDatatableHelper.totalRecordsCount = result.totalCount;
this.primengDatatableHelper.records = result.items;
this.primengDatatableHelper.hideLoadingIndicator();
});
}
reloadPage(): void {
this.paginator.changePage(this.paginator.getPage());
}
createPalierDetail(): void {
this.createOrEditPalierDetailModal.show();
}
deletePalierDetail(palierDetail: PalierDetailDto): void {
this.message.confirm('', isConfirmed => {
if (isConfirmed) {
this._palierDetailsServiceProxy.delete(palierDetail.id).subscribe(() => {
this.reloadPage();
this.notify.success(this.l('SuccessfullyDeleted'));
});
}
});
}
exportToExcel(): void {
this._palierDetailsServiceProxy
.getPalierDetailsToExcel(
this.filterText,
this.palier.code, // filtre les elements du palier séléctionné
this.maxTauxFilter == null ? this.maxTauxFilterEmpty : this.maxTauxFilter,
this.minTauxFilter == null ? this.minTauxFilterEmpty : this.minTauxFilter
)
.subscribe(result => {
this._fileDownloadService.downloadTempFile(result);
});
}
}