An open API service indexing awesome lists of open source software.

https://github.com/emintontul/drawer

Basic drawer component for Angular
https://github.com/emintontul/drawer

angular angular2 drawer ngx-drawer

Last synced: about 1 month ago
JSON representation

Basic drawer component for Angular

Awesome Lists containing this project

README

          

# Drawer

This is a basic drawer component for angular.
## Demo
![](https://www.emintontul.com/demo/drawer/drawer.gif)
## Installation

```bash
npm i @emintontul/drawer
```

## Usage
You'll need to add `MetDrawerModule` to your application module.
```typescript
import { MetDrawerModule, MetDrawerService } from '@emintontul/drawer';
...

@NgModule({
declarations: [
AppComponent
],
imports: [
MetDrawerModule,
...
],
providers: [
MetDrawerService,
...
],
bootstrap: [AppComponent]
})

export class AppModule {
}

```
Add the `met-drawer` attribute:
```typescript
import { Button, MetDrawerService } from '@emintontul/drawer';
@Component({
selector: 'sample',
template:`

HTML or something goes here...

`
})
class SampleDrawer {
isDrawerActive: boolean = false;
buttonArray: Button[] = new Array();
constructor(private drawer: MetDrawerService){
this.buttonArray.push({text: "Save", class: "btn btn-primary", callFunction: this.someFunction});
}
showDrawer(){
this.drawer.showDrawer();
}
someFunction(){
...
}
}
```
That's it! Now you can use drawer.