I'm very sorry for these breaking changes, but I think the new names make more sense and are more consistent than the older ones 😰
-
A few interfaces/properties were renamed:
Old Name New name Description MenuOptionModel
SideMenuOption
Entity that represents options/suboptions displayName
displayText
Property from the SideMenuOption
interface that defines the text to be shown for the option/suboptionsubItems
suboptions
Property from the SideMenuOption
interface that defines the suboptions of the optionselectOption
change
Event emitted when the user selects an option/suboption from the side menu itemHeight
optionHeight
Property from the SideMenuSettings
interface that defines the height for options/suboptionsSideMenuRedirectEvent
SideMenuOptionSelect
Event used to update the selected option/suboption when changing the current page from outside of the side menu SideMenuRedirectEventData
SideMenuOptionSelectData
Entity used to send data when using the SideMenuRedirectEvent
event -
The
subOptionIndentation
property from theSideMenuSettings
interface has been changed and now each mode property is a number instead of a string.
Upgrade Instructions ✅
If you want to update your app from the previous version of this demo project (the one released on 06/01/2018), please follow these steps:
-
Replace the old
MenuOptionModel
type of the options/suboptions by the new typeSideMenuOption
(usually this will affect yourapp.component.ts
file only). So for example the following line:public options: Array<MenuOptionModel>;
should be replaced by:
public options: Array<SideMenuOption>;
Please notice that you'd also need to update the
import
statement as well. -
When creating the options/suboptions, replace the old property name
displayName
by the new property namedisplayText
. So for example the following option:this.options.push({ iconName: 'home', displayName: 'Home', // <-- 'displayName' is the old property name! component: 'HomePage', });
should be replaced by:
this.options.push({ iconName: 'home', displayText: 'Home', // <-- 'displayText' is the new property name! component: 'HomePage', });
-
Also when creating options with suboptions, replace the old
subItems
property by the newsuboptions
property. So for example the following option:this.options.push({ displayText: 'Sub options with icons', subItems: [ { iconName: 'basket', displayText: 'Sub Option 1', component: 'SubOptionOnePage' }, // ... ] });
should be replaced by:
this.options.push({ displayText: 'Sub options with icons', suboptions: [ { iconName: 'basket', displayText: 'Sub Option 1', component: 'SubOptionOnePage' }, // ... ] });
-
Replace the name of the
selectOption
event that is triggered when selecting an option/suboption, by the newchange
event (this should affect yourapp.html
file only). So the following line:<side-menu-content [options]="options" (selectOption)="onOptionSelected($event)"></side-menu-content>
should be replaced by
<side-menu-content [options]="options" (change)="onOptionSelected($event)"></side-menu-content>
-
If you were using the
itemHeight
property from theSideMenuSettings
, replace it by the new nameoptionHeight
. So for example the following lines:public sideMenuSettings: SideMenuSettings = { // ... itemHeight: { md: 56, ios: 64, wp: 56 } };
should be replaced by:
public sideMenuSettings: SideMenuSettings = { // ... optionHeight: { md: 56, ios: 64, wp: 56 } };
-
If you were using the
subOptionIndentation
property from theSideMenuSettings
, replace the values to benumber
s instead ofstring
s. So for example the following lines:public sideMenuSettings: SideMenuSettings = { // ... subOptionIndentation: { md: '56px', ios: '64px', wp: '56px' } };
should be replaced by:
public sideMenuSettings: SideMenuSettings = { // ... subOptionIndentation: { md: 56, ios: 64, wp: 56 } };
-
If you were using the old
SideMenuRedirectEvent
event name and theSideMenuRedirectEventData
type, replace it by the newSideMenuOptionSelect
event name andSideMenuOptionSelectData
type. So for example the following code:const redirectData: SideMenuRedirectEventData = { displayName: 'Option 1' }; this.eventCtrl.publish(SideMenuRedirectEvent, redirectData);
should be replaced by:
const data: SideMenuOptionSelectData = { displayText: 'Option 1' }; this.eventCtrl.publish(SideMenuOptionSelect, data);
Please also keep in mind that the
SideMenuDisplayText
andSideMenuDisplayTextConditions
custom decorators were added to simplify how options can be selected from outside of the side menu so maybe you don't need to use this event at all.