Я работаю над проектом angular, в котором есть компонент navbar. Панель навигации не расширяется на мобильных устройствах. Когда я пытаюсь протестировать панель навигации на любых мобильных устройствах, она выдает ошибку в консоли, как показано на изображении ниже, я перепробовал множество исправлений, но ничего не помогло, может кто-нибудь помочь?
Я использую последнюю версию bootstrap и Jquery.
navbar.component. html
<nav class="navbar navbar-expand-sm navbar-light bg-light" *ngIf="nav.visible">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand">GoNews</a>
<div class="collapse navbar-collapse " id="navbarSupportedContent">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item">
<a class="nav-link" routerLink="/homepage">Home <span class="sr-only">(current)</span></a>
</li>
<li #drop class=" nav-item dropdown dmenu">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" aria-expanded="false" routerLink="/category"
id="navbardrop">
Categories
</a>
<div class="dropdown-menu dmenu">
<a class="dropdown-item text-light" *ngFor="let catlog of dropDownCategories"
(click)="getTitle(catlog.category_name)">{{catlog.displayname}}</a>
</div>
</li>
<li class="nav-item dropdown dmenu ">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Notifiation<span class="caret"></span></a>
<ul class="dropdown-menu dropdown-cart" role="menu">
<li *ngFor="let notification of holdNotifications">
<span class="item">
<span class="item-left">
<img src="{{notification.image}}" alt="" style="width: 50px;" />
<span class="item-info">
<span class="text-light">{{notification.name}}</span>
</span>
</span>
<span class="item-right">
<button class="btn btn-xs btn-danger pull-right">x</button>
</span>
</span>
<hr>
</li>
</ul>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" (click)="signOut()">Sign-Out</a>
</li>
</ul>
</div>
</nav>
navbar.component. css
.navbar{
background: hsl(210, 3%, 28%) !important;
}
.dropdown{
border-radius:0;
border:0;
}
.dropdown-menu{
background: hsl(210, 3%, 28%);
border:0;
top:80%;
border-radius:0px 0px 5px 5px;
}
.dropdown-item:hover{
background:hsl(0, 85%, 55%);
color:#fff;
}
.dropdown-menu a:hover{
color:#fff;
}
.navbar .nav-item .nav-link{
color:#eee !important;
}
.navbar .nav-item .nav-link:hover .navbar .nav-item .nav-link{
color:red !important;
}
ul.dropdown-cart{
min-width:400px;
}
ul.dropdown-cart li .item{
display:block;
padding:3px 10px;
margin: 3px 0;
}
ul.dropdown-cart li .item:hover{
background-color:red;
}
ul.dropdown-cart li .item:after{
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
ul.dropdown-cart li .item-left{
float:left;
}
ul.dropdown-cart li .item-left img,
ul.dropdown-cart li .item-left span.item-info{
float:left;
}
ul.dropdown-cart li .item-left span.item-info{
margin-left:30px;
}
ul.dropdown-cart li .item-left span.item-info span{
display:block;
}
ul.dropdown-cart li .item-right{
float:right;
}
ul.dropdown-cart li .item-right button{
margin-top:10px;
}
angular. json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"gonews": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/gonews",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets",
"src/assets/bgimg.jpg"
],
"styles": [
"src/styles.css",
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"./node_modules/owl.carousel/dist/assets/owl.carousel.min.css",
"./node_modules/owl.carousel/dist/assets/owl.theme.default.min.css",
"./node_modules/animate.css",
"./node_modules/magnific-popup/dist/magnific-popup.css",
"./node_modules/font-awesome/css/font-awesome.min.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/popper.js/dist/umd/popper.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js",
"./node_modules/magnific-popup/dist/jquery.magnific-popup.min.js",
"./node_modules/owl.carousel/dist/owl.carousel.min.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "gonews:build"
},
"configurations": {
"production": {
"browserTarget": "gonews:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "gonews:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "gonews:serve"
},
"configurations": {
"production": {
"devServerTarget": "gonews:serve:production"
}
}
}
}
}
},
"defaultProject": "gonews",
"cli": {
"analytics": "cf65c06e-93a4-4075-b8fe-8856a6d137a4"
}
}
. json
{
"name": "gonews",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~9.0.5",
"@angular/cdk": "^9.2.1",
"@angular/common": "~9.0.5",
"@angular/compiler": "~9.0.5",
"@angular/core": "~9.0.5",
"@angular/flex-layout": "^9.0.0-beta.29",
"@angular/forms": "~9.0.5",
"@angular/platform-browser": "~9.0.5",
"@angular/platform-browser-dynamic": "~9.0.5",
"@angular/router": "~9.0.5",
"@types/jquery": "^3.5.0",
"angular-font-awesome": "^3.1.2",
"angular-randomcolor": "^1.0.3",
"animate.css": "^3.7.2",
"bootstrap": "^4.4.1",
"font-awesome": "^4.7.0",
"jquery": "^3.5.0",
"magnific-popup": "^1.1.0",
"mdbootstrap": "^4.15.0",
"ngx-owl-carousel": "^2.0.7",
"ngx-pagination": "^5.0.0",
"nouislider": "^14.2.0",
"owl.carousel": "^2.3.4",
"popper.js": "^1.16.1",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.900.5",
"@angular/cli": "~9.0.5",
"@angular/compiler-cli": "~9.0.5",
"@angular/language-service": "~9.0.5",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"classy-nav": "^0.4.0",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~5.18.0",
"typescript": "~3.7.5"
}
}