From e35c0de8a85f9790aee1e6bd3b61caec7fb2ea99 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Thu, 25 Aug 2016 12:09:21 -0700 Subject: [PATCH] fix(RC6): add directives for custom elements that are part of the APIs. --- src/lib/card/card.ts | 46 ++++++++++++++++++++++++++++++++++++-- src/lib/list/list.ts | 7 +++++- src/lib/toolbar/toolbar.ts | 9 ++++++-- 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/src/lib/card/card.ts b/src/lib/card/card.ts index 9cb3146662bf..aef5d4953c7a 100644 --- a/src/lib/card/card.ts +++ b/src/lib/card/card.ts @@ -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 {} /* @@ -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({ diff --git a/src/lib/list/list.ts b/src/lib/list/list.ts index ef35a0f8413e..ffbc9a1c1b9c 100644 --- a/src/lib/list/list.ts +++ b/src/lib/list/list.ts @@ -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', @@ -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({ diff --git a/src/lib/toolbar/toolbar.ts b/src/lib/toolbar/toolbar.ts index d8ae92808b48..56ca6c0007df 100644 --- a/src/lib/toolbar/toolbar.ts +++ b/src/lib/toolbar/toolbar.ts @@ -3,11 +3,16 @@ 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', @@ -46,7 +51,7 @@ export class MdToolbar { } /** @deprecated */ -export const MD_TOOLBAR_DIRECTIVES = [MdToolbar]; +export const MD_TOOLBAR_DIRECTIVES = [MdToolbar, MdToolbarRow]; @NgModule({