I am working on an Angular CLI Project where I need to call some jQuery functions.
I have included my js in the angular.json file:
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"src/custom.js"
]
jQuery function:
function A() { alert('A'); }
function B() { alert('B'); }
I have imported jQuery in my component where I need to call these jQuery functions :-
import * as $ from 'jquery';
tsconfig.app.json :
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"allowJs": true,
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
Now, how to import custom.js in my component and how to call these functions A & B?