File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
angular/src/shared/helpers Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import { AppConsts } from '@shared/AppConsts';
2
2
import { UtilsService } from '@abp/utils/utils.service' ;
3
3
4
4
export class SignalRAspNetCoreHelper {
5
- static initSignalR ( ) : void {
6
-
5
+ static initSignalR ( callback ?: ( ) => void ) : void {
7
6
const encryptedAuthToken = new UtilsService ( ) . getCookieValue ( AppConsts . authorization . encrptedAuthTokenName ) ;
8
7
9
8
abp . signalr = {
@@ -16,6 +15,13 @@ export class SignalRAspNetCoreHelper {
16
15
url : '/signalr'
17
16
} ;
18
17
19
- jQuery . getScript ( AppConsts . appBaseUrl + '/assets/abp/abp.signalr-client.js' ) ;
18
+ const script = document . createElement ( 'script' ) ;
19
+ if ( callback ) {
20
+ script . onload = ( ) => {
21
+ callback ( ) ;
22
+ } ;
23
+ }
24
+ script . src = AppConsts . appBaseUrl + '/assets/abp/abp.signalr-client.js' ;
25
+ document . head . appendChild ( script ) ;
20
26
}
21
27
}
You can’t perform that action at this time.
0 commit comments