Search code examples
angularnpmproduction

Mat-Timepicker doesn't display when build --prod


I'm using mat-timepicker v5.1.5 and it works locally.

But when I build the app for production and deploy on Tomcat server, the timepicker do not display. I don't get any error when build --prod neither on server side or browser console.

I tried many versions of mat-timepicker but I keep getting the same result.

Here's my environment :

Angular CLI: 7.3.10
Node: 14.17.4
OS: win32 x64
Angular: 7.2.16
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.13.10
@angular-devkit/build-angular      0.6.3
@angular-devkit/build-optimizer    0.6.3
@angular-devkit/core               7.3.10
@angular-devkit/schematics         7.3.10
@angular/cdk                       7.3.7
@angular/cli                       7.3.10
@angular/flex-layout               7.0.0-beta.24
@angular/material                  7.3.7
@angular/material-moment-adapter   7.3.7
@ngtools/webpack                   6.0.3
@schematics/angular                7.3.10
@schematics/update                 0.13.10
rxjs                               6.5.3
typescript                         3.1.6
webpack                            4.8.3

If you have any idea of what's going on it'll be really helpful.

Thanks


Solution

  • I managed to get a descent result using ngx-material-timepicker and this is how I implemented it :

    <mat-form-field class="col-md-2">
        <input matInput placeholder="Start" [ngxTimepicker]="startPicker" name="start" [format]="24"
                  [value]="myForm.value.start" formControlName="start" readonly>
        <ngx-material-timepicker #startPicker></ngx-material-timepicker>
        <mat-error *ngIf="interventionForm.controls['start'].errors?.check">Error message
        </mat-error>
     </mat-form-field>
    

    Hope that can help someone.