Material: Angular Material Datepicker not working! Other material components working fine.

Created on 6 Apr 2018  路  2Comments  路  Source: angular/material

Bug, feature request, or proposal:

I have tried all that I know, I don't know if its a bug. I am new to JS, Angular..

What is the expected behavior?

Normal functioning of mat-datepicker. All other components of Material library is working as expected. Even the ones with animations.

What is the current behavior?

Only a input box. nothing else.

CodePen and steps to reproduce the issue:

CodePen Demo which shows your issue:
Detailed Reproduction Steps:

What is the use-case or motivation for changing an existing behavior?

Which versions of AngularJS, Material, OS, and browsers are affected?

Angular CLI: 1.7.2
Node: 9.4.0
OS: linux x64
Latest versions of Chrome and Firefox

package.json

"dependencies": {
"@angular/animations": "^5.2.9",
"@angular/cdk": "^5.2.4",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/material": "^5.2.4",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"material-design-icons": "^3.0.1",
"ngx-tooltip": "0.0.9",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
"devDependencies": {
"@angular/cli": "~1.7.2",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"font-awesome": "^4.7.0",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
}
}
app.module.ts

import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatNativeDateModule} from '@angular/material';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatDatepickerModule} from '@angular/material/datepicker';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatSelectModule} from '@angular/material/select';

import { HttpModule } from '@angular/http';
import {TooltipModule} from "ngx-tooltip";
import { AppRoutingModule } from './app-routing.module';
import { HttpClientModule } from '@angular/common/http';

import { AppComponent } from './app.component';

import 'hammerjs';

@NgModule({
declarations: [
AppComponent,

],
imports: [
FormsModule,
HttpModule,
TooltipModule,
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
MatNativeDateModule,
MatDatepickerModule,
MatProgressSpinnerModule,
MatSelectModule,
MatFormFieldModule

],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

app.component.html


Is there anything else we should know? Stack Traces, Screenshots, etc.

matdatepicker

invalid

Most helpful comment

I solved this by adding the "" element. But the docs says its optional. I wasted the whole day doing so many things.

All 2 comments

I solved this by adding the "" element. But the docs says its optional. I wasted the whole day doing so many things.

Please submit Angular Material questions here and issues here. This repo is for AngularJS Material.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

buzybee83 picture buzybee83  路  3Comments

kasajian picture kasajian  路  3Comments

PeerInfinity picture PeerInfinity  路  3Comments

chriseyhorn picture chriseyhorn  路  3Comments

diogodomanski picture diogodomanski  路  3Comments