Skip to content

Commit 2c0dfcb

Browse files
authored
fix(RC6): add directives for custom elements that are part of the APIs. (#1121)
1 parent 97fe211 commit 2c0dfcb

File tree

3 files changed

+58
-5
lines changed

3 files changed

+58
-5
lines changed

src/lib/card/card.ts

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,43 @@
1-
import {NgModule, Component, ViewEncapsulation, ChangeDetectionStrategy} from '@angular/core';
1+
import {
2+
NgModule,
3+
Component,
4+
ViewEncapsulation,
5+
ChangeDetectionStrategy,
6+
Directive
7+
} from '@angular/core';
8+
9+
10+
/**
11+
* Content of a card, needed as it's used as a selector in the API.
12+
*/
13+
@Directive({
14+
selector: 'md-card-content'
15+
})
16+
export class MdCardContent {}
17+
18+
/**
19+
* Title of a card, needed as it's used as a selector in the API.
20+
*/
21+
@Directive({
22+
selector: 'md-card-title'
23+
})
24+
export class MdCardTitle {}
25+
26+
/**
27+
* Sub-title of a card, needed as it's used as a selector in the API.
28+
*/
29+
@Directive({
30+
selector: 'md-card-subtitle'
31+
})
32+
export class MdCardSubtitle {}
33+
34+
/**
35+
* Action section of a card, needed as it's used as a selector in the API.
36+
*/
37+
@Directive({
38+
selector: 'md-card-actions'
39+
})
40+
export class MdCardActions {}
241

342

443
/*
@@ -75,7 +114,10 @@ TODO(kara): update link to demo site when it exists
75114
export class MdCardTitleGroup {}
76115

77116
/** @deprecated */
78-
export const MD_CARD_DIRECTIVES: any[] = [MdCard, MdCardHeader, MdCardTitleGroup];
117+
export const MD_CARD_DIRECTIVES: any[] = [
118+
MdCard, MdCardContent, MdCardHeader, MdCardTitleGroup, MdCardTitle, MdCardSubtitle,
119+
MdCardActions
120+
];
79121

80122

81123
@NgModule({

src/lib/list/list.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import {
1212
} from '@angular/core';
1313
import {MdLine, MdLineSetter, MdLineModule} from '@angular2-material/core/line/line';
1414

15+
@Directive({
16+
selector: 'md-divider'
17+
})
18+
export class MdListDivider {}
19+
1520
@Component({
1621
moduleId: module.id,
1722
selector: 'md-list, md-nav-list',
@@ -66,7 +71,7 @@ export class MdListItem implements AfterContentInit {
6671
}
6772

6873
/** @deprecated */
69-
export const MD_LIST_DIRECTIVES = [MdList, MdListItem, MdListAvatar];
74+
export const MD_LIST_DIRECTIVES = [MdList, MdListDivider, MdListItem, MdListAvatar];
7075

7176

7277
@NgModule({

src/lib/toolbar/toolbar.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ import {
33
Component,
44
ChangeDetectionStrategy,
55
Input,
6-
ViewEncapsulation
6+
ViewEncapsulation,
7+
Directive
78
} from '@angular/core';
89
import {Renderer} from '@angular/core';
910
import {ElementRef} from '@angular/core';
1011

12+
@Directive({
13+
selector: 'md-toolbar-row'
14+
})
15+
export class MdToolbarRow {}
16+
1117
@Component({
1218
moduleId: module.id,
1319
selector: 'md-toolbar',
@@ -46,7 +52,7 @@ export class MdToolbar {
4652
}
4753

4854
/** @deprecated */
49-
export const MD_TOOLBAR_DIRECTIVES = [MdToolbar];
55+
export const MD_TOOLBAR_DIRECTIVES = [MdToolbar, MdToolbarRow];
5056

5157

5258
@NgModule({

0 commit comments

Comments
 (0)