-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datepicker error when builds app Angular #4795
Comments
Hi everyone, since I'm facing the same issue at work, I made the repro-repo: |
@Faqtt0 For now, a temporary solution is a turn off buildOptimizer. |
@Domainv i made the downgrade. But it didn't work. I've changed the version in "package.json" and deleted the folder node_modules. After that, i've made the command "npm install" in the console. |
@Faqtt0 need some small repo to reproduce please Because problem in this repo https://github.com/pehu71/issue4975-demo @pehu71 |
@Domainv I've made what you asked |
@Faqtt0 |
@Domainv |
@Faqtt0 "ngx-bootstrap": "^3.0.1" change to "ngx-bootstrap": "3.0.1" |
@Domainv thanks a lot. |
The component works properly, but when you runs build the angular, you can't see the values, just letters on the datepicker.
![screenshot_1prod](https://user-images.githubusercontent.com/12704298/48362924-def15280-e68b-11e8-9c3b-3ec8bf2f2955.png)
My version "ngx-bootstrap": "^3.1.1",
Build image 1
Build image 2
![screenshot_2prod](https://user-images.githubusercontent.com/12704298/48362968-f4ff1300-e68b-11e8-88c2-37b07bc7cf38.png)
In the html file
<input #dtLanc="bsDatepicker" formControlName="data" placeholder="Data Lançamento" class="form-control text-center" bsDatepicker [maxDate]="maxDate">
component
`import {BsDatepickerConfig, BsDatepickerDirective, BsLocaleService} from 'ngx-bootstrap';
import {defineLocale} from 'ngx-bootstrap/chronos';
defineLocale('pt-br', ptBrLocale);
....
@ViewChild(BsDatepickerDirective) datepicker: BsDatepickerDirective;
locale = 'pt-br';
colorTheme = 'theme-blue';
bsConfig: Partial;
....
maxDate = new Date();
.....
ngOnInit() {
this.initForm();
this.localeService.use(this.locale);
this.bsConfig = Object.assign({}, {containerClass: this.colorTheme});
}
.....
private initForm() {
this.lancForm = this.formBuilder.group({
id: [0],
emp: ['', [Validators.required, CustomValidators.validateAutoCompletePrime('empresa')]],
/emp: [{
empresa: [null]/!,
nome: [null],!/
}, Validators.required],/
data: [new Date(), Validators.required],
valor: ['0.0', Validators.required],
usuario: ['', [Validators.required, CustomValidators.validateAutoCompletePrime('userId')]]
});
}
`
package.json
"dependencies": { "@amcharts/amcharts4": "^4.0.0-beta.39", "@angular/animations": "^6.0.3", "@angular/common": "^6.0.3", "@angular/compiler": "^6.0.3", "@angular/core": "^6.0.3", "@angular/forms": "^6.0.3", "@angular/http": "^6.0.3", "@angular/platform-browser": "^6.0.3", "@angular/platform-browser-dynamic": "^6.0.3", "@angular/router": "^6.0.3", "@fortawesome": "latest", "@fortawesome/fontawesome-free": "^5.4.2", "bootstrap": "^4.1.3", "chart.js": "^2.7.2", "core-js": "^2.5.4", "deep-equal": "^1.0.1", "font-awesome": "^4.7.0", "jquery": "^3.3.1", "jwt-decode": "^2.2.0", "ngx-bootstrap": "^3.1.1", "ngx-device-detector": "^1.3.0", "popper.js": "^1.14.3", "primeicons": "^1.0.0-beta.10", "primeng": "^6.1.4", "rxjs": "^6.0.0", "zone.js": "^0.8.26" }
ng build --prod --base-href=/apptest/
No build image 1
![noprod1](https://user-images.githubusercontent.com/12704298/48362996-034d2f00-e68c-11e8-8d30-5a52310d71bf.png)
![noprod_2](https://user-images.githubusercontent.com/12704298/48363007-0b0cd380-e68c-11e8-8d11-cc044656e850.png)
No build image 2
The text was updated successfully, but these errors were encountered: