I find that my project work fine in my local machine with the ng serve but when I use the ng build prod it doesn't return a model field
I use the below model that is populated by the api node.js
export class Tenders {
public licitacion: string
public fecha: string
public finaliza: string
public producto: number
public descrip: string
public cantidad: number
public unidad: string
public costo: number
public ultcompra: string
public proveedor: number
public provenom: string
public estado: number
}
I use the below code for populate the table.
async pedirTenders(user) {
if (user) {
// console.log('Tenders')
this.tenderService.getTenders()
.subscribe((resp: Tenders[]) => {
console.log(resp.Tenders)
this.dataSource.data = resp.Tenders
this.dataSource.sort = this.sort
this.dataSource.paginator = this.paginator
this.table.dataSource = this.dataSource
})
}
}
And the service for the GetHTTP
getActives(): Observable<Tenders[]> {
return this.http.get<Tenders[]>(this.url.baseApiUrl + 'tendersactives', this.getHttpOptions())
}
When I run the ng serve in my local machine it's return the licitacion field as it's declare in the model and as it can be see in the console screenshot below
But when I run the ng --prod the licitacion field doesn't appear as the screenshot below
The api used for both requests is the same
The package.json use is
{
"name": "comprasmat",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve -o",
"build": "ng --build --base-href /",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^10.1.3",
"@angular/cdk": "^10.2.0",
"@angular/common": "^10.1.3",
"@angular/compiler": "^10.1.3",
"@angular/core": "^10.1.3",
"@angular/flex-layout": "^10.0.0-beta.32",
"@angular/forms": "^10.1.3",
"@angular/localize": "^10.1.3",
"@angular/material": "^10.2.0",
"@angular/platform-browser": "^10.1.3",
"@angular/platform-browser-dynamic": "^10.1.3",
"@angular/router": "^10.1.3",
"@mdi/angular-material": "^5.6.55",
"@mdi/font": "^5.6.55",
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
"bootstrap": "^4.5.2",
"jquery": "^3.5.1",
"moment": "^2.27.0",
"popper.js": "^1.16.1",
"rxjs": "^6.5.5",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.3",
"@angular/cli": "^10.1.3",
"@angular/compiler-cli": "^10.1.3",
"@angular/language-service": "^10.0.11",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "^3.9.7"
},
"optionalDependencies": {
"fsevents": "^2.1.3"
}
}
Thanks in advance for any suggestion
Kind regards
Thank you all for taking the time to answer me. However after adding the await to the async request doesn't resolve the problem. I've changed the get function but the "licitacion" field and all the offer related fileds are still missing
Here is the Html code requested. I'm trying to make a mat-table with a collapsed row that shows the offers subquery. the wire thing it's everything working perfect on my local machine but not in prod environment.
Thanks again