angular-material-course | Angular Material In Depth | Frontend Framework library
kandi X-RAY | angular-material-course Summary
kandi X-RAY | angular-material-course Summary
This repository contains the code of the Angular Material In Depth video course.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of angular-material-course
angular-material-course Key Features
angular-material-course Examples and Code Snippets
Community Discussions
Trending Discussions on angular-material-course
QUESTION
I have been following the Angular Material Data Table paginator tutorial here.
When they construct their paginator, they declare a paginator using
@ViewChild(MatPaginator) paginator: MatPaginator;
in their component.ts file. With this declaration, they are able to access properties later in the same file:
...ANSWER
Answered 2018-Jun-20 at 23:36Based on your template you have the issue with attempting to grab ViewChild fir element that doesn’t exist in DOM due to *ngif directive in the parent div.
There are some options to solve this:
You can replace *ngIf directive with [hidden] which hides your parent div but keeps it in the dom, thus your ViewChild reference will work
More complex if you have to stick to *ngIf - is to ensure your child element can be grabbed as ElementRef (assign id to it and get reference to it AFTER it is created by ngIf set to true) and use of setter for your ViewChild as in this issue:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install angular-material-course
We can install the master branch using the following commands:. 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.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page