error TS1086: An accessor cannot be declared in an ambient context in Angular 9

后端 未结 7 1321
清酒与你
清酒与你 2021-02-03 18:14

I\'m learning Angular Material and I\'m getting this error when importing { MatButtonModule } from \"@angular/material/button\".

From what I read in other answers, it lo

7条回答
  •  闹比i
    闹比i (楼主)
    2021-02-03 19:15

    I solved the same issue by following steps:

    Check the angular version: Using command: ng version My angular version is: Angular CLI: 7.3.10

    After that I have support version of ngx bootstrap from the link: https://www.npmjs.com/package/ngx-bootstrap

    In package.json file update the version: "bootstrap": "^4.5.3", "@ng-bootstrap/ng-bootstrap": "^4.2.2",

    Now after updating package.json, use the command npm update

    After this use command ng serve and my error got resolved

提交回复
热议问题