From 8eaf460af65812a6f69810d837903f67204c43d6 Mon Sep 17 00:00:00 2001 From: Kate <43079840+katebatura@users.noreply.github.com> Date: Sun, 31 Oct 2021 15:59:39 +0300 Subject: [PATCH] feat(window): template as window title (#2915) --- .../theme/components/window/window.component.ts | 8 +++++++- .../theme/components/window/window.options.ts | 11 +++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/framework/theme/components/window/window.component.ts b/src/framework/theme/components/window/window.component.ts index a14fc2c385..3198f98b09 100644 --- a/src/framework/theme/components/window/window.component.ts +++ b/src/framework/theme/components/window/window.component.ts @@ -24,7 +24,13 @@ import { NbWindowRef } from './window-ref'; template: ` -
{{ config.title }}
+
+ +
+ + +
{{ config.title }}
+
diff --git a/src/framework/theme/components/window/window.options.ts b/src/framework/theme/components/window/window.options.ts index 16f46e9b4d..004efb2941 100644 --- a/src/framework/theme/components/window/window.options.ts +++ b/src/framework/theme/components/window/window.options.ts @@ -36,6 +36,17 @@ export class NbWindowConfig { */ title: string = ''; + /** + * Window title as template. Use it instead of `title` property. + */ + titleTemplate?: TemplateRef; + + /** + * Title as template may receive data through `config.titleTemplateContext` property. + * Window title as Template. You can access context inside template as $implicit. + */ + titleTemplateContext?: Object = {}; + /** * Initial window state. Full screen by default. */