-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Custom Header component implementation
- Loading branch information
Yahima Duarte
committed
Sep 9, 2018
1 parent
bb2c482
commit e67cc95
Showing
9 changed files
with
57 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import {Component, ViewContainerRef} from '@angular/core'; | ||
import {ModalDialogService, SimpleModalComponent} from 'ngx-modal-dialog'; | ||
import {CustomModalComponent} from './dialogs/custom-modal.component'; | ||
import {DynamicModalComponent} from './dialogs/dynamic-modal.component'; | ||
import {CustomHeaderModalComponent} from './dialogs/custom-header-modal.component'; | ||
import {ModalDialogHeaderType, ModalDialogService, SimpleModalComponent} from 'ngx-modal-dialog'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
|
@@ -96,13 +96,17 @@ export class AppComponent { | |
|
||
openCustomHeaderModal() { | ||
this.modalDialogService.openDialog(this.viewContainer, { | ||
title: 'Custom child component', | ||
headerComponent: CustomHeaderModalComponent, | ||
childComponent: CustomModalComponent, | ||
childComponent: SimpleModalComponent, | ||
settings: { | ||
closeButtonClass: 'close theme-icon-close' | ||
closeButtonClass: 'close theme-icon-close', | ||
headerType: ModalDialogHeaderType.CUSTOM | ||
}, | ||
data: 'Yahima Duarte <[email protected]>' | ||
data: { | ||
title: 'Yahima Duarte <[email protected]>', | ||
text: `Lorem ipsum is placeholder text commonly used in the graphic, print, | ||
and publishing industries for previewing layouts and visual mockups.` | ||
} | ||
}); | ||
} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import {Component} from '@angular/core'; | ||
import {IModalHeaderDialog} from '../../../../src/modal-dialog.interface'; | ||
import {IModalHeaderDialog} from 'ngx-modal-dialog'; | ||
|
||
@Component({ | ||
selector: 'app-custom-header-modal', | ||
template: ` | ||
<p>This component is a custom header.</p> | ||
<p>Written By: <b>{{data}}</b></p> | ||
<h4>This component is a custom header</h4> | ||
<p>Written By: <b>{{title}}</b></p> | ||
` | ||
}) | ||
export class CustomHeaderModalComponent implements IModalHeaderDialog { | ||
data: string; | ||
title: string; | ||
|
||
setData(data: any) { | ||
this.data = data; | ||
this.title = data['title']; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Directive, ViewContainerRef } from '@angular/core'; | ||
|
||
@Directive({ | ||
selector: '[ad-header]', | ||
}) | ||
export class AdHeaderDirective { | ||
constructor(public viewContainerRef: ViewContainerRef) { } | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum ModalDialogHeaderType { | ||
TITLE = 1, CUSTOM = 2 | ||
} |
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