mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: avoid manually-maintained example lists (#12335)
Reworks the demos that were using the docs examples to avoid having to hard-code the list of examples for each component.
This commit is contained in:
committed by
mmalerba
parent
ed4e082bef
commit
f4fcf7865b
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
import {Component} from '@angular/core';
|
||||
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -14,25 +15,6 @@ import {Component} from '@angular/core';
|
||||
templateUrl: 'table-demo.html',
|
||||
})
|
||||
export class TableDemo {
|
||||
examples = [
|
||||
'table-basic',
|
||||
'table-basic-flex',
|
||||
'cdk-table-basic',
|
||||
'cdk-table-basic-flex',
|
||||
'table-dynamic-columns',
|
||||
'table-filtering',
|
||||
'table-footer-row',
|
||||
'table-http',
|
||||
'table-overview',
|
||||
'table-pagination',
|
||||
'table-row-context',
|
||||
'table-selection',
|
||||
'table-sorting',
|
||||
'table-expandable-rows',
|
||||
'table-sticky-header',
|
||||
'table-sticky-columns',
|
||||
'table-sticky-footer',
|
||||
'table-sticky-complex',
|
||||
'table-sticky-complex-flex',
|
||||
];
|
||||
examples = Object.keys(EXAMPLE_COMPONENTS)
|
||||
.filter(example => example.startsWith('table-') || example.startsWith('cdk-table-'));
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
import {Component} from '@angular/core';
|
||||
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
@@ -14,16 +15,5 @@ import {Component} from '@angular/core';
|
||||
templateUrl: 'tabs-demo.html',
|
||||
})
|
||||
export class TabsDemo {
|
||||
examples = [
|
||||
'tab-group-basic',
|
||||
'tab-group-dynamic-height',
|
||||
'tab-group-stretched',
|
||||
'tab-group-async',
|
||||
'tab-group-custom-label',
|
||||
'tab-group-header-below',
|
||||
'tab-group-theme',
|
||||
'tab-group-lazy-loaded',
|
||||
'tab-group-dynamic',
|
||||
'tab-nav-bar-basic',
|
||||
];
|
||||
examples = Object.keys(EXAMPLE_COMPONENTS).filter(example => example.startsWith('tab-'));
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {Component} from '@angular/core';
|
||||
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
@@ -13,15 +14,5 @@ import {Component} from '@angular/core';
|
||||
templateUrl: 'tooltip-demo.html',
|
||||
})
|
||||
export class TooltipDemo {
|
||||
examples = [
|
||||
'tooltip-overview',
|
||||
'tooltip-position',
|
||||
'tooltip-disabled',
|
||||
'tooltip-message',
|
||||
'tooltip-delay',
|
||||
'tooltip-manual',
|
||||
'tooltip-modified-defaults',
|
||||
'tooltip-auto-hide',
|
||||
'tooltip-custom-class',
|
||||
];
|
||||
examples = Object.keys(EXAMPLE_COMPONENTS).filter(example => example.startsWith('tooltip-'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user