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
- Host: GitHub
- URL: https://github.com/emintontul/drawer
- Owner: emintontul
- Created: 2020-12-26T10:36:27.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-09T22:39:57.000Z (over 5 years ago)
- Last Synced: 2025-02-09T22:45:47.530Z (over 1 year ago)
- Topics: angular, angular2, drawer, ngx-drawer
- Language: TypeScript
- Homepage:
- Size: 147 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Drawer
This is a basic drawer component for angular.
## Demo

## 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.