The issue will occur only when we use the latest angular builder(application, browser-esbuild).The issue can be resolved by following the below steps.
Refer the jQuery script file (jquery.js
) as given in the angular.json
file within the projectname > scripts
section (For example, reportviewerapp > scripts
).
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "reportviewerapp"
},
"reportviewerapp": [
{
"root": "src",
"outDir": "dist",
. . .
. . .
"styles": [],
"scripts": ["./node_modules/jquery/dist/jquery.js"],
. . .
. . .
}
Remove the src/globals.ts
file entirely. Eliminate all references to src/globals.ts
file in both the ts.configapp.json
and src/app/app.module.ts
files.