-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(menu): add support for
subMenuComponent
And fix visibility controls via configuration
- Loading branch information
Alex Malkevich
committed
Feb 27, 2019
1 parent
a9600a3
commit e5fb388
Showing
8 changed files
with
89 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
projects/dynamic-menu/src/lib/dynamic-menu/context-template.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
import { TemplateRef } from '@angular/core'; | ||
|
||
import { DynamicMenuRouteConfig } from '../types'; | ||
|
||
export class DynamicMenuTemplateContext { | ||
constructor( | ||
/** Reference to template with children items */ | ||
public tpl: TemplateRef<any>, | ||
/** Context for {@link TemplateRef} `tpl` */ | ||
public ctx: any, | ||
/** | ||
* @internal | ||
* Parent route config to determine if template should be rendered | ||
*/ | ||
public parentConfig?: DynamicMenuRouteConfig, | ||
) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
...ts/dynamic-menu/src/lib/dynamic-menu/dynamic-menu-items/dynamic-menu-items.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
<ng-container *ngTemplateOutlet="ctx?.tpl; context: ctx?.ctx"></ng-container> | ||
<ng-container *ngIf="(shouldRender$ | async)"> | ||
<ng-container | ||
*ngComponentOutlet="ctx?.parentConfig?.data?.menu?.subMenuComponent" | ||
></ng-container> | ||
<ng-container *ngTemplateOutlet="ctx?.tpl; context: ctx?.ctx"></ng-container> | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters