Skip to content

Commit

Permalink
fix(RC6): add directives for custom elements that are part of the API…
Browse files Browse the repository at this point in the history
…s. (#1121)
  • Loading branch information
hansl authored Aug 25, 2016
1 parent 97fe211 commit 2c0dfcb
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 5 deletions.
46 changes: 44 additions & 2 deletions src/lib/card/card.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
import {NgModule, Component, ViewEncapsulation, ChangeDetectionStrategy} from '@angular/core';
import {
NgModule,
Component,
ViewEncapsulation,
ChangeDetectionStrategy,
Directive
} from '@angular/core';


/**
* Content of a card, needed as it's used as a selector in the API.
*/
@Directive({
selector: 'md-card-content'
})
export class MdCardContent {}

/**
* Title of a card, needed as it's used as a selector in the API.
*/
@Directive({
selector: 'md-card-title'
})
export class MdCardTitle {}

/**
* Sub-title of a card, needed as it's used as a selector in the API.
*/
@Directive({
selector: 'md-card-subtitle'
})
export class MdCardSubtitle {}

/**
* Action section of a card, needed as it's used as a selector in the API.
*/
@Directive({
selector: 'md-card-actions'
})
export class MdCardActions {}


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

/** @deprecated */
export const MD_CARD_DIRECTIVES: any[] = [MdCard, MdCardHeader, MdCardTitleGroup];
export const MD_CARD_DIRECTIVES: any[] = [
MdCard, MdCardContent, MdCardHeader, MdCardTitleGroup, MdCardTitle, MdCardSubtitle,
MdCardActions
];


@NgModule({
Expand Down
7 changes: 6 additions & 1 deletion src/lib/list/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import {
} from '@angular/core';
import {MdLine, MdLineSetter, MdLineModule} from '@angular2-material/core/line/line';

@Directive({
selector: 'md-divider'
})
export class MdListDivider {}

@Component({
moduleId: module.id,
selector: 'md-list, md-nav-list',
Expand Down Expand Up @@ -66,7 +71,7 @@ export class MdListItem implements AfterContentInit {
}

/** @deprecated */
export const MD_LIST_DIRECTIVES = [MdList, MdListItem, MdListAvatar];
export const MD_LIST_DIRECTIVES = [MdList, MdListDivider, MdListItem, MdListAvatar];


@NgModule({
Expand Down
10 changes: 8 additions & 2 deletions src/lib/toolbar/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ import {
Component,
ChangeDetectionStrategy,
Input,
ViewEncapsulation
ViewEncapsulation,
Directive
} from '@angular/core';
import {Renderer} from '@angular/core';
import {ElementRef} from '@angular/core';

@Directive({
selector: 'md-toolbar-row'
})
export class MdToolbarRow {}

@Component({
moduleId: module.id,
selector: 'md-toolbar',
Expand Down Expand Up @@ -46,7 +52,7 @@ export class MdToolbar {
}

/** @deprecated */
export const MD_TOOLBAR_DIRECTIVES = [MdToolbar];
export const MD_TOOLBAR_DIRECTIVES = [MdToolbar, MdToolbarRow];


@NgModule({
Expand Down

0 comments on commit 2c0dfcb

Please sign in to comment.