AOT compilation error
See original GitHub issueHello, I am using v.1.3.0 with Angular 7 and works fine with a simple ng-serve
, but when I build the application with ng-build
and AOT enabled, it fails with the following error:
ERROR in Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'weekdaysMin' was called in 'ɵb'
'ɵb' calls 'weekdaysMin' at ../ngx-daterangepicker-material/ngx-daterangepicker-material.ts(24,17).
I import the picker module in my app module with NgxDaterangepickerMd.forRoot().
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:16 (2 by maintainers)
Top Results From Across the Web
angular - Why won't aot compiler error on missing property?
AoT compiles the template beforehand, and is looking for the bindings to be generated. On the other hand, having it in an ng-container...
Read more >Ahead-of-time (AOT) compilation - Angular
Errors in AOT compilation commonly occur because of metadata that does not conform to the compiler's requirements (as described more fully below).
Read more >Angular 6 AOT compilation not working - Error in ... - GitHub
I created minimal sample app to reproduce this error. The key point is that this app is AOT compiled using the webpack plugin...
Read more >Improved Error Logging by the Angular AOT Compiler
When this component is sent to the compiler, this component compilation already failed and the compiler is not taking it as a valid...
Read more >Angular: Writing AoT-friendly applications | by David - Medium
However, with AoT compilation ( ng build --prod ), we encounter several errors. We will talk through this errors and look how to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
above issues i got solution
localconfi: any = { applyLabel: 'ok',separator: ' To ', format: 'ddd, MMMM D, YYYY h:mm A', direction: 'ltr', weekLabel: 'W', cancelLabel: 'Cancel', customRangeLabel: 'Custom range', daysOfWeek: moment.weekdaysMin(), monthNames: moment.monthsShort(), firstDay: moment.localeData().firstDayOfWeek() };
<input matInput type="text" ngxDaterangepickerMd [(ngModel)]="selected" (ngModelChange)="datepickerChange($event)" [alwaysShowCalendars]="true" [ranges]="ranges" [showClearButton]="true" [locale]="localconfi" placeholder="Double Click for Date" class="form-control" required/> </mat-form-field>
NgxDaterangepickerMd.forRoot({ separator: ' To ', applyLabel: 'Okay', format: 'ddd, MMMM D, YYYY h:mm A' })
@ashokvarmauppalapati hi , can u check your
package.json
?If you a using
^1.2.7
. And runnpm install —force
accidentally, it may reinstall the1.3.0
.Just a gentle reminder, I made the same mistake a few days ago. Better fix the version to
1.2.7