Code Monkey home page Code Monkey logo

angular-material-course's Introduction

Angular Material Course

This repository contains the code of the Angular Material In Depth video course.

This course repository is updated to Angular 18:

Angular Material In Depth

You can find the starting point of the course in the 1-start branch.

This master branch contains the final version of the course code, that you can use as a reference if you choose to code along.

Installation pre-requisites

IMPORTANT: Please use Node 18 LTS (Long Term Support version).

Installing the Angular CLI

With the following command the angular-cli will be installed globally in your machine:

npm install -g @angular/cli 

How To install this repository

We can install the master branch using the following commands:

git clone https://github.com/angular-university/angular-material-course.git

cd angular-material-course
npm ci

Note: We recommend using npm ci, instead of npm install. This will ensure that you use the exact dependency versions set on package-lock.json, unlike npm install which might potentially change those versions.

To Run the Development Backend Server

Our Angular frontend connects to a simple Node server, running also in your local development machine.

We can start the sample application backend with the following command:

npm run server

To run the Development UI Server

Once the backend server is up and running, we can now run our frontend server.

To run the frontend part of our code, we will use the Angular CLI:

npm start 

The application is visible at port 4200: http://localhost:4200

Note: **make sure to use command npm start and not ng serve, as npm start adds a couple extra options that are needed for our project **

Other Courses

Other Courses

Modern Angular With Signals

If you are looking for the Modern Angular With Signals Course, the repo with the full code can be found here:

Modern Angular With Signals Course

Angular Forms In Depth

If you are looking for the Angular Forms In Depth course, the repo with the full code can be found here:

Angular Forms In Depth

Angular Router In Depth

If you are looking for the Angular Router In Depth course, the repo with the full code can be found here:

Angular Router In Depth

NgRx (with NgRx Data) - The Complete Guide

If you are looking for the Ngrx (with NgRx Data) - The Complete Guide, the repo with the full code can be found here:

Ngrx (with NgRx Data) - The Complete Guide

Angular Core Deep Dive Course

If you are looking for the Angular Core Deep Dive Course, the repo with the full code can be found here:

Angular Core Deep Dive

RxJs In Practice

If you are looking for the RxJs In Practice, the repo with the full code can be found here:

RxJs In Practice Course

NestJs In Practice (with MongoDB)

If you are looking for the NestJs In Practice Course, the repo with the full code can be found here:

NestJs In Practice Course

Angular Testing Course

If you are looking for the Angular Testing Course, the repo with the full code can be found here:

Angular Testing Course

Serverless Angular with Firebase Course

If you are looking for the Serverless Angular with Firebase Course, the repo with the full code can be found here:

Serverless Angular with Firebase Course

Angular Universal Course

If you are looking for the Angular Universal Course, the repo with the full code can be found here:

Angular Universal Course

Angular PWA Course

If you are looking for the Angular PWA Course, the repo with the full code can be found here:

Angular PWA Course - Build the future of the Web Today

Angular Security Masterclass

If you are looking for the Angular Security Masterclass, the repo with the full code can be found here:

Angular Security Masterclass.

Angular Security Masterclass

Angular Advanced Library Laboratory Course

If you are looking for the Angular Advanced Course, the repo with the full code can be found here:

Angular Advanced Library Laboratory Course: Build Your Own Library.

Angular Advanced Library Laboratory Course: Build Your Own Library

RxJs and Reactive Patterns Angular Architecture Course

If you are looking for the RxJs and Reactive Patterns Angular Architecture Course code, the repo with the full code can be found here:

RxJs and Reactive Patterns Angular Architecture Course

RxJs and Reactive Patterns Angular Architecture Course

Complete Typescript Course - Build A REST API

If you are looking for the Complete Typescript 2 Course - Build a REST API, the repo with the full code can be found here:

https://angular-university.io/course/typescript-2-tutorial

Github repo for this course

Complete Typescript Course

angular-material-course's People

Contributors

angular-academy-devs avatar jhades avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-material-course's Issues

npm install -g

don't forget to tell newbies to prefix the npm install -g with sudo.

Form field validators not working in lesson on Material Input Field

Spent a long time scratching head over this one...in the lesson called "Angular Material Input Field: Lots Of Useful Options" the <mat-error> directive isn't working. The problem occurs around 11 mins and 20 seconds in the video.

Here's the my code:

import {Component} from '@angular/core';
import {FormBuilder, Validators} from '@angular/forms';


@Component({
  selector: "create-course-step-1",
  templateUrl:"create-course-step-1.component.html",
  styleUrls: ["create-course-step-1.component.scss"]
})
export class CreateCourseStep1Component {

  form = this.fb.group({
    title: ['', [
      Validators.required,
      Validators.minLength(5),
      Validators.maxLength(60)
    ]],
    releasedAt: [new Date(), Validators.required],
    category: ['BEGINNER', Validators.required],
    courseType: ['premium', Validators.required],
    downloadsAllowed: [false, Validators.requiredTrue],
    longDescription: ['', [Validators.required, Validators.minLength(3)]]
  });

  constructor(private fb: FormBuilder) {

  }

  get courseTitle() {
    return this.form.controls['title'];
  }

}

...and here's the html code:


<div [formGroup]="form" class="course-details-form">

    <mat-form-field floatLabel="auto">
        <input matInput placeholder="Course title" formControlname="title" #title>
        <mat-hint align="end">{{title.value.length}} / 60</mat-hint>
        <mat-error *ngIf="courseTitle.errors?.minlength">
            A minimum length of 5 characters is required.
        </mat-error>
    </mat-form-field>

</div>

I've tried all kinds of things, but it just seems like the minLength() validator isn't working. At the moment I have no confidence that any of the validators are working. Any clues much appreciated.

Cards instead of rows?

This is an impressive example. Filtering, pagination, http requests, updated to angular 7....I need every bit of that, but I need a grid of cards instead of a table of rows.

How difficult would it be to switch to cards? Suggestions for getting started?

Below are some other approaches I'm exploring, but these don't support filtering.

https://stackoverflow.com/questions/47853598/trying-to-use-angular-material-paginator-without-a-table

https://stackoverflow.com/questions/50810413/how-to-use-angular-material-pagination-with-mat-card

Thanks for sharing,

--Erik

Paginator and the "lessonsCount"

The mat-paginator page counter is based on a "static" property of a course lessonsCount :

<mat-paginator [length]="course?.lessonsCount"

export const COURSES: any = {

    1: {
        id: 1,
        description: "Angular for Beginners",
        iconUrl: 'https://angular-academy.s3.amazonaws.com/thumbnails/angular2-for-beginners-small-v2.png',
        courseListIcon: 'https://angular-academy.s3.amazonaws.com/main-logo/main-page-logo-small-hat.png',
        longDescription: "Establish a solid layer of fundamentals, learn what's under the hood of Angular",
        category: 'BEGINNER',
        lessonsCount: 10
    }

and

export const LESSONS = {

    1: {
        id: 1,
        "description": "Angular Tutorial For Beginners - Build Your First App - Hello World Step By Step",
        "duration": "4:17",
        "seqNo": 1,
        courseId: 1
    },
    2: {
        id: 2,
        "description": "Building Your First  Component - Component Composition",
        "duration": "2:07",
        "seqNo": 2,
        courseId: 1
    }

is there a way to remove that property from the course class and use the number of lessons based on the lessons count from the db via courseId, and not from the course property "lessonsCount"?

Pagination from serverside not working

Please update code for paginator correct working...

loadLessons(courseId:number,
                filter:string,
                sortDirection:string,
                pageIndex:number,
                pageSize:number) {

        this.loadingSubject.next(true);

        this.coursesService.findLessons(courseId, filter, sortDirection,
            pageIndex, pageSize).pipe(
                catchError(() => of([])),
                finalize(() => this.loadingSubject.next(false))
            )
            .subscribe((lessonList: LessionList) => {
               this.lessonsSubject.next(lessonList.payload)
               this._updatePaginator(lessonsList.total)
      });
}

get paginator(): MatPaginator | null { return this._paginator; }
  set paginator(paginator: MatPaginator|null) {
    this._paginator = paginator;
    //this._updateChangeSubscription();
  }
  private _paginator: MatPaginator|null;
  
  _updatePaginator(filteredDataLength: number) {
    Promise.resolve().then(() => {
      if (!this.paginator) { return; }

      this.paginator.length = filteredDataLength;

      // If the page index is set beyond the page, reduce it to the last page.
      if (this.paginator.pageIndex > 0) {
        const lastPageIndex = Math.ceil(this.paginator.length / this.paginator.pageSize) - 1 || 0;
        this.paginator.pageIndex = Math.min(this.paginator.pageIndex, lastPageIndex);
      }
    });
  }

then update server side and CoursesService to get LessionList from server.

LessionList {
  payload: lession[];
  total: number
}

and then insert this line after dataSource initialization in CourseComponent:

this.dataSource.paginator = this.paginator;

This implementation work correctly.

Does not run

Found this example and it sounded great. I got the zip from github and tried it out. The SSL cert is not valid it would appear.

Table does not display

Hi,

I can see the tabs and the menu, but the table can not be displayed under any tab. Why is that?

Thank you

Even simplest example crashes.

Hello there,

i've cloned the project via git and did all nessessary steps as described in the video. The project compiles, but it crashes with the following message:

ERROR TypeError: this._sliderInput is undefined

I've updated cli, core and material packages via: ng update @angular/core @angular/cli and ng update @angular/material successfully but the application itself still crashing.

Thanks for any help.

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.