Skip to content

Commit 4227262

Browse files
authored
Merge pull request #307 from willhartman/feat/configurable-html-title
feat(angular-playground): Initial HTML Title Configuration
2 parents fa68482 + b19f762 commit 4227262

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

projects/playground/src/lib/core/playground.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class PlaygroundModule {
4040

4141
static configure(configuration: Configuration) {
4242
PlaygroundModule.setSandboxDefinitions(configuration.sandboxesDefined);
43-
initializePlayground(configuration.selector);
43+
initializePlayground(configuration.selector, configuration.htmlTitle);
4444
_middleware.next({..._middleware.value, ...configuration});
4545
return this;
4646
}

projects/playground/src/lib/lib/initialize-playground.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
export const initializePlayground = (elementNameToReplace?: string) => {
3-
document.getElementsByTagName('title')[0].innerHTML = 'Playground';
2+
export const initializePlayground = (elementNameToReplace?: string, htmlTitle: string = 'Playground') => {
3+
document.getElementsByTagName('title')[0].innerHTML = htmlTitle;
44
if (elementNameToReplace && elementNameToReplace.length > 0) {
55
let appNode = document.getElementsByTagName(elementNameToReplace)[0];
66
if (!appNode) {

projects/playground/src/lib/lib/middlewares.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface Configuration {
66
modules?: any[];
77
overlay?: boolean;
88
sandboxesDefined: Type<Sandboxes>;
9+
htmlTitle: string;
910
}
1011

1112
export interface Middleware {

0 commit comments

Comments
 (0)