<igx-expansion-panel><igx-expansion-panel-header><igx-expansion-panel-title>
Golden Retriever
</igx-expansion-panel-title><igx-expansion-panel-description>
Medium-large gun dog
</igx-expansion-panel-description></igx-expansion-panel-header><igx-expansion-panel-body>
The Golden Retriever is a medium-large gun dog that retrieves shot waterfowl, such as ducks and upland game birds, during hunting and shooting parties.[3] The name "retriever" refers to the breed's ability to retrieve shot game undamaged due to their soft mouth. Golden retrievers have an instinctive love of water, and are easy to train to basic or advanced obedience standards.
</igx-expansion-panel-body></igx-expansion-panel>html
このサンプルが気に入りましたか? 完全な Ignite UI for Angularツールキットにアクセスして、すばやく独自のアプリの作成を開始します。無料でダウンロードできます。
// home.component.tsimport { IGX_EXPANSION_PANEL_DIRECTIVES } from'igniteui-angular';
// import { IGX_EXPANSION_PANEL_DIRECTIVES } from '@infragistics/igniteui-angular'; for licensed package@Component({
selector: 'app-home',
template: `
<igx-expansion-panel>
<igx-expansion-panel-header>
<igx-expansion-panel-title>
Golden Retriever
</igx-expansion-panel-title>
<igx-expansion-panel-description>
Medium-large gun dog
</igx-expansion-panel-description>
</igx-expansion-panel-header>
<igx-expansion-panel-body>
The Golden Retriever is a medium-large gun dog that retrieves shot waterfowl,
such as ducks and upland game birds, during hunting and shooting parties.
The name "retriever" refers to the breed's ability to retrieve shot game undamaged due to their soft mouth.
Golden retrievers have an instinctive love of water, and are easy to train to basic or advanced obedience standards.
</igx-expansion-panel-body>
</igx-expansion-panel>
`,
styleUrls: ['home.component.scss'],
standalone: true,
imports: [IGX_EXPANSION_PANEL_DIRECTIVES]
/* or imports: [IgxExpansionPanelComponent, IgxExpansionPanelHeaderComponent, IgxExpansionPanelTitleDirective, IgxExpansionPanelDescriptionDirective, IgxExpansionPanelBodyComponent] */
})
exportclassHomeComponent{}
typescript
Ignite UI for Angular Expansion Panel モジュールまたはディレクティブをインポートしたので、igx-expansion-panel コンポーネントの使用を開始できます。
// in expansion-panel.component.tsimport { IgxExpansionPanelComponent } from'igniteui-angular';
// import { IgxExpansionPanelComponent } from '@infragistics/igniteui-angular'; for licensed package@Component({...})
exportclassExpansionPanelComponent{
@ViewChild(IgxExpansionPanelComponent, {read: IgxExpansionPanelComponent})
public panel: IgxExpansionPanelComponent;
}
typescript
<!-- in expansion-component.component.html --><igx-expansion-panel><igx-expansion-panel-header>
Golden Retriever
<igx-expansion-panel-description *ngIf="panel.collapsed">
Medium-large gun dog
</igx-expansion-panel-description></igx-expansion-panel-header>
...
</igx-expansion-panel>html
<igx-expansion-panel (contentExpanded)="handleExpansion($event)" (contentCollapsed)="handleCollapse($event)"><igx-expansion-panel-header><igx-expansion-panel-title>
Golden Retriever
</igx-expansion-panel-title><igx-expansion-panel-description *ngIf="panel.collapsed">
Medium-large gun dog
</igx-expansion-panel-description></igx-expansion-panel-header><igx-expansion-panel-body>
The Golden Retriever is a medium-large gun dog that retrieves shot waterfowl, such as ducks and upland game birds, during hunting and shooting parties.[3] The name "retriever" refers to the breed's ability to retrieve shot game undamaged due to their soft mouth. Golden retrievers have an instinctive love of water, and are easy to train to basic or advanced obedience standards.
</igx-expansion-panel-body></igx-expansion-panel><igx-toast [displayTime]="1500" #eventToast></igx-toast>html
<!-- in expansion-panel.component.html -->
...
<igx-expansion-panel-body><divclass="example-content"><img [src]="imgSource"alt="dog-image">
The Golden Retriever is a medium-large gun dog that retrieves shot waterfowl, such as ducks and upland game birds, during hunting and shooting parties. The name "retriever" refers to the breed's ability to retrieve shot game undamaged due to their soft mouth. Golden retrievers have an instinctive love of water, and are easy to train to basic or advanced obedience standards.
<aigxButton="outlined"target="_blank" [href]="readMore">Read more</a></div></igx-expansion-panel-body>
...
html
<divclass="sample-holder"><igx-expansion-panelclass="my-expansion-panel"><igx-expansion-panel-header [iconPosition]="'right'"><igx-expansion-panel-title>
Golden Retriever
</igx-expansion-panel-title><igx-expansion-panel-description>
Medium-large gun dog
</igx-expansion-panel-description><igx-expansion-panel-icon><spanclass="example-icon" *ngIf="panel.collapsed">Show more</span><spanclass="example-icon" *ngIf="!panel.collapsed">Show Less</span></igx-expansion-panel-icon></igx-expansion-panel-header><igx-expansion-panel-body><divclass="example-content"><imgheight="100" [src]="imgSource"alt=""><span>
The Golden Retriever is a medium-large gun dog that retrieves shot waterfowl, such as ducks and upland game birds, during hunting and shooting parties.[3] The name "retriever" refers to the breed's ability to retrieve shot game undamaged due to their soft mouth. Golden retrievers have an instinctive love of water, and are easy to train to basic or advanced obedience standards.
</span><aigxButton="outlined"target="_blank" [href]="readMore">Read more</a></div></igx-expansion-panel-body></igx-expansion-panel></div>html
// In real life, this should be in our main sass file so we can share the palette between all components. // In our case, it's in the component SCSS file "expansion-styling.component.scss".@use"igniteui-angular/theming" as *;
// IMPORTANT: Prior to Ignite UI for Angular version 13 use:// @import '~igniteui-angular/lib/core/styles/themes/index';// Add your brand colors.$my-primary-color:#353a4b;
$my-secondary-color: #ffd351;
$my-surface-color: #efefef;
// Create custom palette.$my-color-palette: palette(
$primary: $my-primary-color,
$secondary: $my-secondary-color,
$surface: $my-surface-color
);
scss
<divclass="sample-holder"><igx-expansion-panelclass="my-expansion-panel"><igx-expansion-panel-header [iconPosition]="'right'"><igx-expansion-panel-title>
Golden Retriever
</igx-expansion-panel-title><igx-expansion-panel-description>
Medium-large gun dog
</igx-expansion-panel-description></igx-expansion-panel-header><igx-expansion-panel-body><divclass="example-content"><imgheight="100" [src]="imgSource"alt=""><span>
The Golden Retriever is a medium-large gun dog that retrieves shot waterfowl, such as ducks and upland game birds, during hunting and shooting parties.[3] The name "retriever" refers to the breed's ability to retrieve shot game undamaged due to their soft mouth. Golden retrievers have an instinctive love of water, and are easy to train to basic or advanced obedience standards.
</span><aigxButton="raised"target="_blank" [href]="readMore">Read more</a></div></igx-expansion-panel-body></igx-expansion-panel></div>html
<!-- in expansion-panel.component.html -->
...
<igx-expansion-panel [animationSettings] = "animationSettingsCustom"class="my-expansion-panel"><igx-expansion-panel-header><igx-expansion-panel-titleclass="sample-title">Angular</igx-expansion-panel-title></igx-expansion-panel-header><igx-expansion-panel-body>
Angular (commonly referred to as "Angular 2+" or "Angular v2 and above") is a TypeScript-based open-source web application framework led by the Angular Team at Google and by a community of individuals and corporations.
</igx-expansion-panel-body></igx-expansion-panel>
...
html
<divclass="sample-holder"><igx-expansion-panel [animationSettings] = "animationSettingsCustom"class="my-expansion-panel"><igx-expansion-panel-header><igx-expansion-panel-titleclass="sample-title">Angular</igx-expansion-panel-title></igx-expansion-panel-header><igx-expansion-panel-body>
Angular (commonly referred to as "Angular 2+" or "Angular v2 and above") is a TypeScript-based open-source web application framework led by the Angular Team at Google and by a community of individuals and corporations.
</igx-expansion-panel-body></igx-expansion-panel></div>html