Skip to content

Commit 601204d

Browse files
committed
docs(button): more detail on MdAnchor. (#466)
1 parent 4e1d85e commit 601204d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/components/button/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# md-button
22

3-
`md-button` is an HTML `<button>` or `<a>` tag enhanced with styling and animation to match the [spec of a Material Design button](https://www.google.com/design/spec/components/buttons.html).
3+
`md-button` is an HTML `<button>` or `<a>` tag enhanced with styling and animation to match the
4+
[Material Design button spec](https://www.google.com/design/spec/components/buttons.html).
5+
6+
Users should employ a button element (`<button>`) when clicking triggers some action in the current
7+
view *without navigating*. An anchor element (`<a>`) should be used when clicking *navigates*
8+
the user to another URL. Depending on which element is used, the component will either be an
9+
instance of `MdButton` or `MdAnchor`. Visually, the two are identical.
10+
411

512
### Button types
613

@@ -103,4 +110,4 @@ Properties:
103110
| Name | Type | Description |
104111
| --- | --- | --- |
105112
| `color` | `"primary"|"accent"|"warn"` | The color palette of the button
106-
| `disabled` | boolean | Whether or not the button is disabled
113+
| `disabled` | boolean | Whether or not the button is disabled

src/components/button/button.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ChangeDetectionStrategy,
77
ElementRef,
88
Renderer,
9+
Type,
910
} from '@angular/core';
1011

1112
// TODO(jelbourn): Ink ripples.
@@ -132,3 +133,6 @@ export class MdAnchor extends MdButton {
132133
}
133134
}
134135
}
136+
137+
138+
export const MD_BUTTON_DIRECTIVES: Type[] = [MdButton, MdAnchor];

0 commit comments

Comments
 (0)