I am using VS 2015 as my IDE. I have read the following: Angular 2 typescript invoke javascript function
and
Using a Javascript Function from Typescript
and
Using a Javascript Function from Typescript
however, i still don't get the basic.
assuming that i have testing.js and app.component.ts
var testJs = function () {
this.asd = 123;
}
testJs.prototype.testing = function (param) {
console.log(param);
}
How do I use testJs in my app.component.ts? at the moment i try this but failed:
import { Component } from '@angular/core';
interface testJs {
testing: Function;
}
declare var testJs: testJs;
@Component({
selector: 'my-app',
templateUrl: '/mainTemplate.html'
})
export class AppComponent {
testJs.testing("adsf");
}
I have tried the following and it still does not work as well.
and I don't have angular.cli. is it possible to do it without angular.cli?