Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
echeung-amzn committed Jul 13, 2016
1 parent 13ec296 commit bbada47
Showing 1 changed file with 53 additions and 7 deletions.
60 changes: 53 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,59 @@

An Angular 2 sidebar component.

*Documentation coming soon*


### Development
## Installation

```shell
npm install
typings install
npm start
```
npm install --save ng2-sidebar
```


## Usage

Import the component and add it to the list of directives on your component:

```typescript
import Sidebar from 'ng2-sidebar';

@Component({
selector: 'example',
directives: [Sidebar],
template: `
<ng2-sidebar [(open)]="_open">
<p>Sidebar contents</p>
</ng2-sidebar>
<button (click)="_toggleSidebar()">Toggle sidebar</button>
`
})
export class MyComponent {
private _open: boolean = false;

private _toggleSidebar() {
this._open = !this._open;
}
}
```

### Options

#### `[(open)]="boolean_value"`
Boolean input value that controls the visibility of the sidebar. This should be two-way bound in case
the value changes when the sidebar is closed by clicking outside of it when `closeOnClickOutside` is
enabled.

#### `[pullRight]="boolean_value"`
Boolean input value

#### `[closeOnClickOutside]="boolean_value"`
Boolean input value that controls whether clicking outside of the open sidebar will close it.

#### `[sidebarClassName]="'string_value'"`
A string used as an additional class name on the sidebar element.

#### `(onOpen)="func_call()"`
An output event, emitted when the sidebar is opened.

#### `(onClose)="func_call()"`
An output event, emitted when the sidebar is closed.

0 comments on commit bbada47

Please sign in to comment.