-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(platform,core): custom title and subtitle template for dynamic p…
…age (#10065) * fix(platform): custom subtitle template for dynamic page * feat(core,platform): custom dynamic page title * fix(platform): fix build --------- Co-authored-by: Denis Severin <[email protected]>
- Loading branch information
Showing
19 changed files
with
318 additions
and
22 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
libs/core/src/lib/dynamic-page/directives/dynamic-page-header-subtitle.directive.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Directive, TemplateRef, inject } from '@angular/core'; | ||
import { DynamicPageTitleDirectiveContext } from '../models/title-directive-context'; | ||
|
||
@Directive({ | ||
selector: '[fdDynamicPageHeaderSubtitle]', | ||
standalone: true | ||
}) | ||
export class DynamicPageHeaderSubtitleDirective { | ||
/** Template reference. */ | ||
templateRef = inject<TemplateRef<DynamicPageTitleDirectiveContext>>(TemplateRef); | ||
|
||
/** @hidden */ | ||
static ngTemplateContextGuard( | ||
dir: DynamicPageHeaderSubtitleDirective, | ||
ctx: DynamicPageTitleDirectiveContext | ||
): ctx is DynamicPageTitleDirectiveContext { | ||
return true; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
libs/core/src/lib/dynamic-page/directives/dynamic-page-header-title.directive.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Directive, TemplateRef, inject } from '@angular/core'; | ||
import { DynamicPageTitleDirectiveContext } from '../models/title-directive-context'; | ||
|
||
@Directive({ | ||
selector: '[fdDynamicPageHeaderTitle]', | ||
standalone: true | ||
}) | ||
export class DynamicPageHeaderTitleDirective { | ||
/** Template reference. */ | ||
templateRef = inject<TemplateRef<DynamicPageTitleDirectiveContext>>(TemplateRef); | ||
|
||
/** @hidden */ | ||
static ngTemplateContextGuard( | ||
dir: DynamicPageHeaderTitleDirective, | ||
ctx: DynamicPageTitleDirectiveContext | ||
): ctx is DynamicPageTitleDirectiveContext { | ||
return true; | ||
} | ||
} |
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
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
4 changes: 4 additions & 0 deletions
4
libs/core/src/lib/dynamic-page/models/title-directive-context.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface DynamicPageTitleDirectiveContext { | ||
/** Whether the header is collapsed */ | ||
$implicit: boolean; | ||
} |
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
15 changes: 11 additions & 4 deletions
15
...amic-page/examples/dynamic-page-facets-example/dynamic-page-facets-example.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
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
Oops, something went wrong.