We can integrate Angular Material in Ionic easily, we have to follow Configuration certain step
ionic new angularMaterial blank
- npm install –save @angular/material @angular/cdk @angular/animationse
- Adding a custom copy script, Copy the file copy.config.js file and past in new location with folder name config in the root folder. Ionic includes a copy script file that is called during the build process when you run
and it’s responsible for moving certain resources from tonode_modules
the www folder,
- Rename the copy.config.ts to copy-custom-libs.js: append the following code along with existing code at the end.
- Open index.html of root folder, add following code in <head>
<link href=”assets/css/indigo-pink.css” rel=”stylesheet”/>
- Last but not least, we need to instruct Ionic that we want to use our new copy script as opposed to the one that is included already. For that, we need to open our package.JSON file and add the following section We can restart our apps, we can use material theme indigo-pink.cs in our apps.
Add the following code in src/pages/home/home.html
Add the following code in src/pages/home/home.ts