Угловая сборка cli с AOT (- prod) выдает ошибку во время выполнения по нажатию mat-autocomplete или любого другого элемента материала, ошибка, которую я получаю, приведена ниже
ERROR TypeError: this._document.createElement is not a function
at t._createHostElement (main.dbeb1735f9287d0af752.js:1)
at t.create (main.dbeb1735f9287d0af752.js:1)
at t._attachOverlay (main.dbeb1735f9287d0af752.js:1)
at t._handleFocus (main.dbeb1735f9287d0af752.js:1)
at Object.handleEvent (0.6098c61070f0a4810ed2.js:1)
at Object.handleEvent (main.dbeb1735f9287d0af752.js:1)
at Object.handleEvent (main.dbeb1735f9287d0af752.js:1)
at cr (main.dbeb1735f9287d0af752.js:1)
at main.dbeb1735f9287d0af752.js:1
at HTMLInputElement. (main.dbeb1735f9287d0af752.js:1)
Это появляется толькопосле сборки приложения angular 6 с AOT (- PROD) и при нажатии на элемент mat-autocomplete все работает без ошибок при запуске приложения с ng serve
Вот мой package.json
{
"name": "mr",
"version": "2.1.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
},
"private": true,
"dependencies": {
"@agm/core": "1.0.0-beta.2",
"@angular/animations": "6.1.3",
"@angular/cdk": "6.4.6",
"@angular/common": "6.1.3",
"@angular/compiler": "6.1.3",
"@angular/core": "6.1.3",
"@angular/forms": "6.1.3",
"@angular/http": "6.1.3",
"@angular/material": "6.4.6",
"@angular/material-moment-adapter": "^6.4.7",
"@angular/platform-browser": "6.1.3",
"@angular/platform-browser-dynamic": "6.1.3",
"@angular/platform-server": "6.1.4",
"@angular/router": "6.1.3",
"@auth0/angular-jwt": "^2.0.0",
"ajv": "6.4.0",
"arrive": "2.4.1",
"bootstrap": "4.1.0",
"bootstrap-material-design": "4.1.1",
"bootstrap-notify": "3.1.3",
"chartist": "0.11.0",
"classlist.js": "1.1.20150312",
"core-js": "2.5.5",
"googleapis": "28.1.0",
"hammerjs": "2.0.8",
"jquery": "3.2.1",
"moment": "^2.22.2",
"ng-pick-datetime": "^5.2.6",
"ngx-bootstrap": "^3.0.1",
"perfect-scrollbar": "1.1.0",
"popper.js": "1.14.3",
"rxjs": "6.2.2",
"rxjs-compat": "6.2.2",
"web-animations-js": "2.3.1",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.7.1",
"@angular/cli": "^6.1.4",
"@angular/compiler-cli": "6.1.4",
"@angular/language-service": "6.1.4",
"@types/bootstrap": "3.3.32",
"@types/chartist": "0.9.34",
"@types/googlemaps": "^3.30.8",
"@types/jasmine": "2.5.38",
"@types/jquery": "1.10.31",
"@types/node": "^6.0.73",
"codelyzer": "4.2.1",
"jasmine-core": "3.1.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "2.0.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.4.2",
"karma-jasmine": "1.1.1",
"protractor": "^5.4.0",
"ts-node": "5.0.1",
"tslint": "5.9.1",
"typescript": "2.9.2"
}
}
Код автозаполнения
<div class="col-md-4">
<mat-form-field class="example-full-width">
<input type="text" placeholder="Choose SubCategory/Type" aria-
label="Number" matInput formControlName="subCatogoryCtrl"
(keyup)="changeMySubCategoryControl()"
[matAutocomplete]="auto2">
<mat-autocomplete #auto2="matAutocomplete"
(optionSelected)="onSubCategorySelectionChanged($event)"
[displayWith]="displayFn">
<mat-option *ngFor="let subCategory of subCategories"
[value]="subCategory">
{{subCategory.name}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</div>
Проблема не только в автозаполнении, все элементы материала имеют одинаковое поведение
Пробное обновление @ angular-devkit / build-angular до 0,7.1 не работает