Giter VIP home page Giter VIP logo

angular-material-'s Introduction

Angular-Material

Day 1: Intro to Angular Material.

Q: What is angular material?
A: Angular material is an UI component library.
  • It means that this library provides us with components to build awesome UI with inbuilt/pre existing code quickly.
  • It is mainly the angular's implementation(flavour) to the Google's material design specification.
  • There are many flavours of Google's material design for example React has material UI, Vue has vuetify etc.

Pre-requisites:

  • Html, css, JS, Angular(basics).

Course Structure:

  • How to add angular to project.
  • Typography
  • Components
    • Buttons and Indicators
    • Navigation
    • Layout
    • Form controls
    • Popups and modals
    • Data tables

Adding Material to our project:

  • To install Angular material in our project we need to use the command npm add @angular/material.
  • This command will add schematics to our project and will make some changes to our project. Adding Mat lib to the project
    • App.module.ts - This file will be injected with browseranimations module to support material animations.
    • Angular.json - This file will be updated with the angular material css links.
    • Package.json - This file is updated with the current available angular material version and cdk.
    • Package.lock.json - This file is updated with some configuration. (we can prolly ignore this).
    • Index.html - In this file links(of google fonts cdn) are added in head section of the file. and body style is set to mat-typography.
    • Styles.css - In this file some css reset(margin and padding to 0) takes place and roboto font is imported and used as default font.

Now to ensure that material is working fine just run the app using ng serve and see if you notice any change in font and if so then material UI is working fine and we are good to go further.

Day 2: Material Module.

  • As you work more and more with material UI you end up with importing almost all the modules into the app.component.ts file which looks cluttered. Creating a module
  • So to maintain professionalism it is recommeded to follow the material module approach as a good practice.
  • So, What is this approach?
    • It is nothing. Just create a module file and name it material module(as it contains all material modules import).
    • Create it using the command ng g m material-module
    • And instead of importing all the material UI components in app.module.ts just import them into material module by creating an components array and exporting them instead.
    • Follow below screenshot for more Also see the it log history to know in depth about which files are being affected at each step. Material Module App Module

Testing Material Module:

To test the mat lib just edit the app.comp.html and use mat-button to see the effects. App comp html App comp html result

angular-material-'s People

Contributors

shahbaazx786 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.