dolfo-angular 1.220.0 → 1.222.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2158,6 +2158,7 @@ class RouteConfig {
|
|
|
2158
2158
|
pathMatch = "full";
|
|
2159
2159
|
title;
|
|
2160
2160
|
canActivate = [];
|
|
2161
|
+
canDeactivate = [];
|
|
2161
2162
|
constructor(path, withRouteCheck = true) {
|
|
2162
2163
|
this.path = path;
|
|
2163
2164
|
if (withRouteCheck)
|
|
@@ -2175,6 +2176,13 @@ class RouteConfig {
|
|
|
2175
2176
|
this.redirectTo = url;
|
|
2176
2177
|
return this;
|
|
2177
2178
|
};
|
|
2179
|
+
addCanDeactivate = (guard) => {
|
|
2180
|
+
if (Array.isArray(guard))
|
|
2181
|
+
this.canDeactivate.push(...guard);
|
|
2182
|
+
else
|
|
2183
|
+
this.canDeactivate.push(guard);
|
|
2184
|
+
return this;
|
|
2185
|
+
};
|
|
2178
2186
|
addGuard = (guard) => {
|
|
2179
2187
|
if (Array.isArray(guard))
|
|
2180
2188
|
this.canActivate.push(...guard);
|
|
@@ -2188,7 +2196,8 @@ class RouteConfig {
|
|
|
2188
2196
|
pathMatch: this.pathMatch,
|
|
2189
2197
|
title: this.title,
|
|
2190
2198
|
redirectTo: this.redirectTo,
|
|
2191
|
-
canActivate: this.canActivate
|
|
2199
|
+
canActivate: this.canActivate,
|
|
2200
|
+
canDeactivate: this.canDeactivate
|
|
2192
2201
|
});
|
|
2193
2202
|
}
|
|
2194
2203
|
|