Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Ng2 Bootstrap Modal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Globars Forks
Ng2 Bootstrap Modal
Commits
77591ca3
Commit
77591ca3
authored
Jan 24, 2017
by
avovchuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lazy create dialogs holder
parent
fcf9c493
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
src/dialog.service.ts
src/dialog.service.ts
+7
-3
No files found.
src/dialog.service.ts
View file @
77591ca3
...
@@ -19,9 +19,7 @@ export class DialogService {
...
@@ -19,9 +19,7 @@ export class DialogService {
* @param {ApplicationRef} applicationRef
* @param {ApplicationRef} applicationRef
* @param {Injector} injector
* @param {Injector} injector
*/
*/
constructor
(
private
resolver
:
ComponentFactoryResolver
,
private
applicationRef
:
ApplicationRef
,
private
injector
:
Injector
)
{
constructor
(
private
resolver
:
ComponentFactoryResolver
,
private
applicationRef
:
ApplicationRef
,
private
injector
:
Injector
)
{}
this
.
dialogHolderComponent
=
this
.
createDialogHolder
();
}
/**
/**
* Adds dialog
* Adds dialog
...
@@ -31,6 +29,9 @@ export class DialogService {
...
@@ -31,6 +29,9 @@ export class DialogService {
* @return {Observable<any>}
* @return {Observable<any>}
*/
*/
addDialog
(
component
:
Type
<
DialogComponent
>
,
data
?:
any
,
index
?:
number
):
Observable
<
any
>
{
addDialog
(
component
:
Type
<
DialogComponent
>
,
data
?:
any
,
index
?:
number
):
Observable
<
any
>
{
if
(
!
this
.
dialogHolderComponent
)
{
this
.
dialogHolderComponent
=
this
.
createDialogHolder
();
}
return
this
.
dialogHolderComponent
.
addDialog
(
component
,
data
,
index
);
return
this
.
dialogHolderComponent
.
addDialog
(
component
,
data
,
index
);
}
}
...
@@ -39,6 +40,9 @@ export class DialogService {
...
@@ -39,6 +40,9 @@ export class DialogService {
* @param {DialogComponent} component
* @param {DialogComponent} component
*/
*/
removeDialog
(
component
:
DialogComponent
):
void
{
removeDialog
(
component
:
DialogComponent
):
void
{
if
(
!
this
.
dialogHolderComponent
)
{
return
;
}
this
.
dialogHolderComponent
.
removeDialog
(
component
);
this
.
dialogHolderComponent
.
removeDialog
(
component
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment