Skip to content

Commit b6bb985

Browse files
SvetlanaMuravlovadaniloff200
authored andcommitted
feat(modal): edited id type
1 parent 69f68bd commit b6bb985

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/modal/bs-modal-ref.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class BsModalRef<T = any> {
1414
/**
1515
* Allow user to ID for the modal. Otherwise, a unique number will be given
1616
*/
17-
id?: number;
17+
id?: number | string;
1818

1919
/**
2020
* Reference to a component inside the modal. Null if modal's been created with TemplateRef

src/modal/bs-modal.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class BsModalService {
7878
return this._showModal<T>(content);
7979
}
8080

81-
hide(id?: number) {
81+
hide(id?: number | string) {
8282
if (this.modalsCount === 1 || id == null) {
8383
this._hideBackdrop();
8484
this.resetScrollbar();
@@ -164,7 +164,7 @@ export class BsModalService {
164164
return bsModalRef;
165165
}
166166

167-
_hideModal(id?: number): void {
167+
_hideModal(id?: number | string): void {
168168
if (id != null) {
169169
const indexToRemove = this.loaders.findIndex(loader => loader.instance?.config.id === id);
170170
const modalLoader = this.loaders[indexToRemove];
@@ -245,7 +245,7 @@ export class BsModalService {
245245
this.loaders.push(loader);
246246
}
247247

248-
private removeLoaders(id?: number): void {
248+
private removeLoaders(id?: number | string): void {
249249
if (id != null) {
250250
const indexToRemove = this.loaders.findIndex(loader => loader.instance?.config.id === id);
251251
if (indexToRemove >= 0) {

src/modal/modal-options.class.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class ModalOptions<T = Record<string, unknown>> {
66
/**
77
* Allow user to ID for the modal. Otherwise, a unique number will be given
88
*/
9-
id?: number;
9+
id?: number | string;
1010
/**
1111
* Includes a modal-backdrop element. Alternatively,
1212
* specify static for a backdrop which doesn't close the modal on click.

0 commit comments

Comments
 (0)