'For angular material, in which module is the md-content directive and how do I import it?

In the context of an angular material typescript app, I am trying to use the md-content directive listed in the angular material documentation here:

https://material.angularjs.org/latest/demo/content And here: https://material.angularjs.org/latest/api/directive/mdContent

But I cannot figure out how to import the right angular material module which contains this directive.

I tried searching all the available modules here: https://material.angular.io/components/toolbar/api

I tried importing all the available module as listed here: How to import all Angular Material modules in Angular 9

None of the above has worked, i still get the basic error: "error NG8001: 'md-content' is not a known element."

Please note that I am able to import and use all the other modules just fine. I am just not able to find this specific one.



Solution 1:[1]

Are you using Angularjs? or Angular (from Angular2 to Angular12,13,...).

I say this because the doc you show is old, for angularjs, not for Angular which has its own in: material.angular.io

A new componet that fits with yours (mdcontent), could be this one, < mat-expansion-panel > :

https://material.angular.io/components/expansion/overview

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Juan Vicente Berzosa Tejero