API reference for Angular Material card
import {MatCardModule} from '@angular/material/card';
Directives
MatCard
A basic content container component that adds the styles of a Material design card.
While this component can be used alone, it also provides a number of preset styles for common card sections, including:
- mat-card-title
- mat-card-subtitle
- mat-card-content
- mat-card-actions
- mat-card-footer
Selector: mat-card
Exported as: matCardAPI reference for Angular Material card-testing
import {MatCardHarness} from '@angular/material/card/testing';
Classes
MatCardHarness
extends
ContentContainerComponentHarness
Harness for interacting with a standard mat-card in tests.
Methods
async
getAllChildLoaders
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader[]>
|
|
async
getAllHarnesses
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T[]>
|
|
async
getChildLoader
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader>
|
|
async
getHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T>
|
|
async
getSubtitleText
|
|
---|---|
Gets the cards's subtitle text. |
|
Returns | |
Promise<string>
|
|
async
getText
|
|
---|---|
Gets all of the card's content as text. |
|
Returns | |
Promise<string>
|
|
async
getTitleText
|
|
---|---|
Gets the cards's title text. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
Interfaces
CardHarnessFilters
A set of criteria that can be used to filter a list of MatCardHarness
instances.
Properties
Name | Description |
---|---|
|
Only find instances whose subtitle matches the given value. |
|
Only find instances whose text matches the given value. |
|
Only find instances whose title matches the given value. |