Angular material version for angular 5 app

12,931

Solution 1

With Angular 5, you can use angular material 5. Execute the following commands to install ver 5.2.5 of @angular/material and @angular/cdk:

npm install --save @angular/[email protected] 
npm install --save @angular/[email protected]

Solution 2

For the newer version of angular v.6.0 you can use :

npm install --save @angular/[email protected]
npm install --save @angular/[email protected]

One new command is added in the latest CLI ver. (you need to update to the latest ver of CLI)

ng add @angular/material 

this will automatically add the compatible ver in the package.json file.

Share:
12,931
arun kumar
Author by

arun kumar

Updated on July 17, 2022

Comments

  • arun kumar
    arun kumar almost 2 years

    I'm building an angular5 application for this I need angular material, which version of angular material compatible with angular 5 application and how to install it.

  • arun kumar
    arun kumar about 6 years
    what is the use of angular cdk
  • Faisal
    Faisal about 6 years
    The Angular CDK gives developers solid, well-tested tools to add common interaction patterns with minimal effort. Read more about it here: blog.angular.io/a-component-dev-kit-for-angular-9f06e3b4b3b4
  • javan.rajpopat
    javan.rajpopat about 5 years
    @Faisal I am currently on angular version 6.1.10 and I recently downloaded the latest version of /material and /cdk. My question is, will version 8.0.0 of /material be compatible with version 6.1.10 of Angular??
  • kravisingh
    kravisingh about 5 years
    @javan.rajpopat It's not compatible.
  • javan.rajpopat
    javan.rajpopat about 5 years
    @Faisal Thank you for the fast response! :)
  • Sachin Parashar
    Sachin Parashar almost 5 years
    Apart from material and cdk, you might also need to install @angular/animations.