What steps are you using to add angular maetrial to your project?
The prooper way to add the angular material project to your project are:-
- Install angular material via ng add @angular/material
- Import the Angular Material COmponent that you need in app.module.ts:
imports: [
BrowserModule,
NoopAnimationsModule,
MatAutocompleteModule,
MatButtonModule,
MatCheckboxModule,
MatButtonToggleModule,
MatPseudoCheckboxModule,
MatDatepickerModule,
MatFormFieldModule,
MatInputModule,
MatRadioModule,
MatSelectModule,
MatSliderModule,
MatSlideToggleModule
]
- Use the components in the HTML file where you want to use it
<mat-checkbox>Check me!</mat-checkbox>
Hope this helps.
On Friday, January 24, 2020 at 1:13:42 AM UTC+5:30, gopal krishna wrote:
>
> Hi All,
>
> Am using angular 8 and trying to install angular material using ng add
> @angular/material
>
> am getting below error :
>
> Unable to fetch package metadata: Cannot read property 'startsWith' of null
>
> can someone tell me what all I should be looking at,
> my hello world PGM runs fine in angular 8 but unable to install material
> on the machine (windows)
>
>
> package.json
> {
> "name": "hello-world",
> "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": "~8.2.14",
> "@angular/common": "~8.2.14",
> "@angular/compiler": "~8.2.14",
> "@angular/core": "~8.2.14",
> "@angular/forms": "~8.2.14",
> "@angular/platform-browser": "~8.2.14",
> "@angular/platform-browser-dynamic": "~8.2.14",
> "@angular/router": "~8.2.14",
> "@coreui/angular": "^2.7.2",
> "@coreui/coreui": "^2.1.16",
> "@coreui/icons": "^1.0.0",
> "rxjs": "~6.4.0",
> "tslib": "^1.10.0",
> "zone.js": "~0.9.1"
> },
> "devDependencies": {
> "@angular-devkit/build-angular": "~0.803.21",
> "@angular/cli": "~8.3.21",
> "@angular/compiler-cli": "~8.2.14",
> "@angular/language-service": "~8.2.14",
> "@types/node": "~8.9.4",
> "@types/jasmine": "~3.3.8",
> "@types/jasminewd2": "~2.0.3",
> "codelyzer": "^5.0.0",
> "jasmine-core": "~3.4.0",
> "jasmine-spec-reporter": "~4.2.1",
> "karma": "~4.1.0",
> "karma-chrome-launcher": "~2.2.0",
> "karma-coverage-istanbul-reporter": "~2.0.1",
> "karma-jasmine": "~2.0.1",
> "karma-jasmine-html-reporter": "^1.4.0",
> "protractor": "~5.4.0",
> "ts-node": "~7.0.0",
> "tslint": "~5.15.0",
> "typescript": "~3.5.3"
> }
> }
>
>
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/angular/cee4d999-3fce-4e28-b53e-7ce4c9fcfe08%40googlegroups.com.