question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tree: importing MatIconModule and MatButtonModule is necessary

See original GitHub issue

It would be helpful to mention in the API reference for Angular Material tree that besides the MatTreeModule also MatIconModule and MatButtonModule must be imported into the app.module.ts. (eg. when you use a “Tree with flat nodes”)

import {MatButtonModule} from '@angular/material/button';
import {MatIconModule} from '@angular/material/icon';
import {MatTreeModule} from '@angular/material/tree';

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
romualdnavecommented, Aug 26, 2020

@crisbeto Considering most of the components usage examples are using mat-icon-button directive or <mat-icon> selector would this still be relevant (another example being the Menu component) ? Should some kind of global mention to these necessary imports be considered in the documentation then ?

0reactions
angular-automatic-lock-bot[bot]commented, Jun 26, 2021

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to import "@angular/material" module - Stack Overflow
First, you need to install angular material by command: ... import {MatCardModule, MatIconModule, MatToolbarModule} from '@angular/material'.
Read more >
Getting Started with Angular Material - Melissa Houghton
To use the material components in the app, we need to import them. ... import { CdkTreeModule } from '@angular/cdk/tree'; import ...
Read more >
Stop Using Shared Material Module - Angular inDepth
Now, let's remove the Shared Material module and import only the modules which are needed. In employee.module.ts import MatFormFieldModule and MatSelectModule ...
Read more >
Angular Material 7 - Tree - Tutorialspoint
Angular Material 7 - Tree, The , an Angular Directive, is used to create a tree with ... MatIconModule, MatButtonModule} from '@angular/material' import...
Read more >
Angular Material Module Setup - Full Stack Soup
You will still need to take care of the imports which is discussed in ... import { MatButtonModule } from '@angular/material/button'; import ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found