2

查看行为 - https://drive.google.com/file/d/1NG-CdTq3EgjDX8kc8VOSkPimYOzjdFSA/view

当我调整浏览器大小时,它会显示 mat-calendar 的内容,但最初它是空白的。

在此处输入图像描述

<mat-form-field> <input matInput [matDatepicker]="picker" placeholder="Choose a date"> <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> <mat-datepicker #picker></mat-datepicker> </mat-form-field>

MatDatepickerModule 和 MatNativeDateModule 已导入..

Package.json 依赖项

"private": true,
  "dependencies": {
    "@angular/animations": "^6.0.7",
    "@angular/cdk": "^5.2.5",
    "@angular/common": "6.0.7",
    "@angular/compiler": "6.0.7",
    "@angular/core": "6.0.7",
    "@angular/flex-layout": "^6.0.0-beta.16",
    "@angular/forms": "6.0.7",
    "@angular/http": "6.0.7",
    "@angular/material": "^5.2.5",
    "@angular/platform-browser": "6.0.7",
    "@angular/platform-browser-dynamic": "6.0.7",
    "@angular/router": "6.0.7",
    "angular-bootstrap-md": "^6.0.1",
    "angularfire2": "^5.0.0-rc.6",
    "bootstrap": "^4.1.1",
    "chart.js": "^2.5.0",
    "core-js": "^2.4.1",
    "firebase": "4.12.1",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "ng4-geoautocomplete": "^0.1.0",
    "ngx-toastr": "^8.8.0",
    "promise-polyfill": "7.1.2",
    "rxjs": "^6.2.1",
    "rxjs-compat": "^6.2.1",
    "rxjs-tslint": "^0.1.5",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "^6.0.8",
    "@angular/compiler-cli": "6.0.7",
    "@angular/language-service": "6.0.7",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "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.7.2",
    "@angular-devkit/build-angular": "~0.6.8"
  }
}

为什么它不起作用?我应该改变什么调整?我也在使用 MDBootsrap,这可能是问题吗?

更新

对 package.json 进行了一些更新 让事情再次正常运行有点混乱,因此请谨慎使用。

{
  "name": "kai.starter",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve ",
    "start-prod": "ng serve --aot --prod --configuration production",
    "build": "ng build --aot --prod --configuration production",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.0.7",
    "@angular/cdk": "^5.2.5",
    "@angular/common": "6.0.7",
    "@angular/compiler": "6.0.7",
    "@angular/core": "6.0.7",
    "@angular/flex-layout": "^6.0.0-beta.16",
    "@angular/forms": "6.0.7",
    "@angular/http": "6.0.7",
    "@angular/material": "^5.2.5",
    "@angular/platform-browser": "6.0.7",
    "@angular/platform-browser-dynamic": "6.0.7",
    "@angular/router": "6.0.7",
    "@ng-bootstrap/ng-bootstrap": "^3.0.0",
    "@ngrx/store": "^6.0.1",
    "@ngrx/store-devtools": "^6.0.1",
    "angularfire2": "^5.0.0-rc.7",
    "bootstrap": "^4.1.1",
    "chart.js": "^2.5.0",
    "core-js": "^2.4.1",
    "firebase": "4.12.1",
    "font-awesome": "^4.7.0",
    "hammerjs": "^2.0.8",
    "jquery": "^3.3.1",
    "ng-bootstrap": "^1.6.3",
    "ng4-geoautocomplete": "^0.1.0",
    "ngx-geoautocomplete": "^0.1.1",
    "ngx-toastr": "^8.8.0",
    "promise-polyfill": "7.1.2",
    "rxjs": "^6.2.2",
    "rxjs-compat": "^6.2.2",
    "rxjs-tslint": "^0.1.5",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "^6.0.8",
    "@angular/compiler-cli": "6.0.7",
    "@angular/language-service": "6.0.7",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "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.7.2",
    "@angular-devkit/build-angular": "~0.6.8"
  }
}

它突然开始工作,没有具体解释是什么问题..我也从项目中删除了 mdbootsrap,但在此之前它也运行良好。

4

0 回答 0