Skip to content

📋 This is tutorial code by Dmytro Mezhenskyi, from Decoded Frontend, to practise a higher level of Angular programming.

License

Notifications You must be signed in to change notification settings

AndrewJBateman/angular-material-advanced

Repository files navigation

⚡ Angular Material Advanced

This is code by Dmytro Mezhenskyi, from Decoded Frontend - see 👏 Inspiration below, to learn a higher level of Angular programming. The main modules are:

  • advanced-search-form search from a list of countries shown in a drop-down list
  • complex-form-control Custom form field control with Angular Material & Reactive Forms using the Angular Material design component library
  • overlay-example Angular Date Range Picker
  • patterns example Bridge Angular design pattern: velocity and weather widgets using a common wrapper
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • Multiple tutorial modules use the same code base - selected in app.component.html by commenting out unused modules

Uses these Angular features

RxJS

  • RxJS iif used to subscribe to first or second observable based on a condition
  • RxJS merge to turn multiple observables into a single observable
  • RxJS EMPTY to creates an Observable that emits no items to the Observer and immediately emits a complete notification - with no scheduler.
  • RxJS Subject a special type of Observable that allows values to be multicasted to many Observers.

📷 Screenshots

Example screenshot Example screenshot

📶 Technologies

💾 Setup

  • Install dependencies using npm i
  • ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
  • Individual modules are selected in the app.component.html by commenting out the other modules

💻 Code Examples

  • Init lifecycle: toggle focus, pass form changes to the onChange lifecycle hook
ngOnInit(): void {
    this.focusMonitor.monitor(this.input).subscribe((focused) => {
      this.focused = !!focused;
      this.stateChanges.next();
    });
    this.focusMonitor
      .monitor(this.input)
      .pipe(take(1))
      .subscribe(() => {
        this.onTouch();
      });
    this.form.valueChanges.subscribe((value) => this.onChange(value));
  }

🆒 Features

  • Rxjs is easy to read and implement

📋 Status & To-Do List

  • Status: One error: Argument of type 'ErrorStateMatcher' is not assignable to parameter of type 'FormGroupDirective'. Type 'ErrorStateMatcher' is missing the following properties from type 'FormGroupDirective': validators, asyncValidators, submitted, _oldForm, and 50 more.ts(2345)
  • To-Do: Fix (type) error which is caused by Angular removing CanUpdateErrorStateCtor & CanDisableCtor from @angular/material/core as not required

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact

About

📋 This is tutorial code by Dmytro Mezhenskyi, from Decoded Frontend, to practise a higher level of Angular programming.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published