Comparing version 0.0.15 to 0.0.16
{ | ||
"name": "ng2-modal", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "Open modal window (dialog box) for your angular2 applications using bootstrap3.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import { EventEmitter, OnDestroy, OnInit } from "@angular/core"; | ||
import { NavigationExtras } from "@angular/router/src/router"; | ||
import { Router } from "@angular/router"; | ||
import { Router, ActivatedRoute } from "@angular/router"; | ||
export declare class RouteModal implements OnInit, OnDestroy { | ||
private router; | ||
private activatedRoute; | ||
cancelUrl: any[]; | ||
@@ -21,3 +22,3 @@ cancelUrlExtras: NavigationExtras; | ||
private backdropElement; | ||
constructor(router: Router); | ||
constructor(router: Router, activatedRoute: ActivatedRoute); | ||
ngOnInit(): void; | ||
@@ -24,0 +25,0 @@ ngOnDestroy(): void; |
@@ -17,4 +17,5 @@ "use strict"; | ||
// ------------------------------------------------------------------------- | ||
function RouteModal(router) { | ||
function RouteModal(router, activatedRoute) { | ||
this.router = router; | ||
this.activatedRoute = activatedRoute; | ||
this.closeOnEscape = true; | ||
@@ -69,4 +70,9 @@ this.closeOnOutsideClick = true; | ||
document.body.className = document.body.className.replace(/modal-open\b/, ""); | ||
if (this.cancelUrl) | ||
this.router.navigate(this.cancelUrl, this.cancelUrlExtras); | ||
if (this.cancelUrl) { | ||
var navigationExtras = { relativeTo: this.activatedRoute }; | ||
if (this.cancelUrlExtras) { | ||
navigationExtras = Object.assign(this.cancelUrlExtras); | ||
} | ||
this.router.navigate(this.cancelUrl, navigationExtras); | ||
} | ||
}; | ||
@@ -142,3 +148,3 @@ // ------------------------------------------------------------------------- | ||
}), | ||
__metadata('design:paramtypes', [router_1.Router]) | ||
__metadata('design:paramtypes', [router_1.Router, router_1.ActivatedRoute]) | ||
], RouteModal); | ||
@@ -145,0 +151,0 @@ return RouteModal; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42715
369