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 {Component} from '@angular/core';
|
||||||
|
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -14,25 +15,6 @@ import {Component} from '@angular/core';
|
|||||||
templateUrl: 'table-demo.html',
|
templateUrl: 'table-demo.html',
|
||||||
})
|
})
|
||||||
export class TableDemo {
|
export class TableDemo {
|
||||||
examples = [
|
examples = Object.keys(EXAMPLE_COMPONENTS)
|
||||||
'table-basic',
|
.filter(example => example.startsWith('table-') || example.startsWith('cdk-table-'));
|
||||||
'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',
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
|
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
moduleId: module.id,
|
moduleId: module.id,
|
||||||
@@ -14,16 +15,5 @@ import {Component} from '@angular/core';
|
|||||||
templateUrl: 'tabs-demo.html',
|
templateUrl: 'tabs-demo.html',
|
||||||
})
|
})
|
||||||
export class TabsDemo {
|
export class TabsDemo {
|
||||||
examples = [
|
examples = Object.keys(EXAMPLE_COMPONENTS).filter(example => example.startsWith('tab-'));
|
||||||
'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',
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
|
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
moduleId: module.id,
|
moduleId: module.id,
|
||||||
@@ -13,15 +14,5 @@ import {Component} from '@angular/core';
|
|||||||
templateUrl: 'tooltip-demo.html',
|
templateUrl: 'tooltip-demo.html',
|
||||||
})
|
})
|
||||||
export class TooltipDemo {
|
export class TooltipDemo {
|
||||||
examples = [
|
examples = Object.keys(EXAMPLE_COMPONENTS).filter(example => example.startsWith('tooltip-'));
|
||||||
'tooltip-overview',
|
|
||||||
'tooltip-position',
|
|
||||||
'tooltip-disabled',
|
|
||||||
'tooltip-message',
|
|
||||||
'tooltip-delay',
|
|
||||||
'tooltip-manual',
|
|
||||||
'tooltip-modified-defaults',
|
|
||||||
'tooltip-auto-hide',
|
|
||||||
'tooltip-custom-class',
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user