File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ export class UsersAddComponent {
42
42
private toastService : ToastService ) {
43
43
44
44
this . visible . subscribe ( ( visible : Boolean ) => {
45
+ let root = this . router . url . split ( '?' ) [ 0 ] . split ( '/' ) [ 1 ] ;
46
+
45
47
if ( visible ) {
46
48
this . form = this . formBuilder . group ( {
47
49
Name : this . formBuilder . control ( {
@@ -76,10 +78,10 @@ export class UsersAddComponent {
76
78
77
79
this . renderer . addClass ( document . body , 'overflow' ) ;
78
80
this . renderer . setProperty ( this . panel . nativeElement , 'scrollTop' , '0' ) ;
79
- this . location . go ( this . router . url . split ( '?' ) [ 0 ] + '/new' ) ;
81
+ this . location . go ( root + '/new' ) ;
80
82
} else {
81
83
this . renderer . removeClass ( document . body , 'overflow' ) ;
82
- this . location . go ( this . router . url . split ( '?' ) [ 0 ] ) ;
84
+ this . location . go ( root ) ;
83
85
}
84
86
} ) ;
85
87
}
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ export class UsersEditComponent {
42
42
@Inject ( LOCALE_ID ) private locale : string ) {
43
43
44
44
this . visible . subscribe ( ( visible : Boolean ) => {
45
+ let root = this . router . url . split ( '?' ) [ 0 ] . split ( '/' ) [ 1 ] ;
46
+
45
47
if ( visible ) {
46
48
this . form = this . formBuilder . group ( {
47
49
Name : this . formBuilder . control ( {
@@ -76,12 +78,10 @@ export class UsersEditComponent {
76
78
77
79
this . renderer . addClass ( document . body , 'overflow' ) ;
78
80
this . renderer . setProperty ( this . panel . nativeElement , 'scrollTop' , '0' ) ;
79
- console . log ( route ) ;
80
- console . log ( router ) ;
81
- this . location . go ( this . router . url . split ( '?' ) [ 0 ] + '/' + this . user . Id ) ;
81
+ this . location . go ( root + '/' + this . user . Id ) ;
82
82
} else {
83
83
this . renderer . removeClass ( document . body , 'overflow' ) ;
84
- this . location . go ( this . router . url . split ( '?' ) [ 0 ] ) ;
84
+ this . location . go ( root ) ;
85
85
}
86
86
} ) ;
87
87
}
You can’t perform that action at this time.
0 commit comments