0.0.7 • Published 2 years ago
@spheremall_org/common-module v0.0.7
Sm-Common
This package includes common components for SphereMall products.
- Sidenav-menu
Installation
- app.module.ts:
import {SmCommonModule} from '@spheremall_org/common-module';
@NgModule({
imports: [SmCommonModule]
})
- app.components.ts:
export class AppComponent {
menuColor = 'black'; // default is black
menuSelectionColor = 'lightgray'; // defaul is lightgray
menuItems = [
{
title : 'Menu item',
icon : 'mat-icon',
children: [
{
title: 'Sub-menu item',
link : 'sub-menu-item,',
icon : 'mat-icon'
},
]
}
]
}
- app.component.html:
<mat-toolbar class="header-panel">
<mat-toolbar-row>
<div class="app-title">
<sm-navigation-hamburger-button></sm-navigation-hamburger-button>
</div>
</mat-toolbar-row>
</mat-toolbar>
<sm-navigation
[menuItems]="menuItems"
[color]="menuColor"
[selectionColor]="menuSelectionColor"
></sm-navigation>
- styles.scss:
app-root {
display: flex;
flex-wrap: wrap;
}
.content-wrapper {
flex: 1;
}