Skip to content

Commit c534cae

Browse files
authored
Merge pull request #462 from aspnetboilerplate/maliming/issue4578
Modify the SignalR script loading method.
2 parents 4fac08f + 1aef91d commit c534cae

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

angular/src/shared/helpers/SignalRAspNetCoreHelper.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { AppConsts } from '@shared/AppConsts';
22
import { UtilsService } from '@abp/utils/utils.service';
33

44
export class SignalRAspNetCoreHelper {
5-
static initSignalR(): void {
6-
5+
static initSignalR(callback?: () => void): void {
76
const encryptedAuthToken = new UtilsService().getCookieValue(AppConsts.authorization.encrptedAuthTokenName);
87

98
abp.signalr = {
@@ -16,6 +15,13 @@ export class SignalRAspNetCoreHelper {
1615
url: '/signalr'
1716
};
1817

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);
2026
}
2127
}

0 commit comments

Comments
 (0)