Reputation: 82
I just came back to Angular after a few years away. There are what appear to be redundant Material libraries. They have two conventions: "@angular/material" and "angular-material". There are "animations" and "animate", as well as "route" and "router".
Also, some sites suggest using "ng add x" while others suggest "npm install x".
Maybe this is totally normal, but I worry I fell into an outdated-docs trap.
Can any Angular experts out there help? Are these conflicting libs, or do they have important differences?
Thanks in advance!
Here are the dependencies in my brand new project:
"dependencies": {
"@angular/animations": "~11.2.1",
"@angular/cdk": "^11.2.1",
"@angular/common": "~11.2.1",
"@angular/compiler": "~11.2.1",
"@angular/core": "~11.2.1",
"@angular/forms": "~11.2.1",
"@angular/material": "^11.2.1",
"@angular/platform-browser": "~11.2.1",
"@angular/platform-browser-dynamic": "~11.2.1",
"@angular/router": "~11.2.1",
"angular": "^1.8.2",
"angular-animate": "^1.8.2",
"angular-aria": "^1.8.2",
"angular-material": "^1.2.2",
"angular-messages": "^1.8.2",
"angular-route": "^1.8.2",
"angular-sanitize": "^1.8.2",
"crypto-js": "^4.0.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"
}
Upvotes: 0
Views: 56
Reputation: 139
You have angularJS (this is the v1 of angular) and Angular "@angular/core": "~11.2.1" (lastest version of angular) in this project.
You need to remove this if you want to work angular:
"angular": "^1.8.2"
"angular-animate": "^1.8.2",
"angular-aria": "^1.8.2",
"angular-material": "^1.2.2",
"angular-messages": "^1.8.2",
"angular-route": "^1.8.2",
"angular-sanitize": "^1.8.2",
Or if you want to work with angularJS remove:
"@angular/animations": "~11.2.1",
"@angular/cdk": "^11.2.1",
"@angular/common": "~11.2.1",
"@angular/compiler": "~11.2.1",
"@angular/core": "~11.2.1",
"@angular/forms": "~11.2.1",
"@angular/material": "^11.2.1",
"@angular/platform-browser": "~11.2.1",
"@angular/platform-browser-dynamic": "~11.2.1",
"@angular/router": "~11.2.1"
Additional its good idea if you install angular CLI to create applications that already works and follow the best practices. From the web cli.angular.io You can run:
npm install -g @angular/cli
ng new my-dream-app
cd my-dream-app
ng serve
Have nice day!
Upvotes: 1