Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginator and the "lessonsCount" #9

Open
moldovans opened this issue Sep 27, 2018 · 0 comments
Open

Paginator and the "lessonsCount" #9

moldovans opened this issue Sep 27, 2018 · 0 comments

Comments

@moldovans
Copy link

moldovans commented Sep 27, 2018

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"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant