Say, you have a simple Javascript function such as sayHello()
:
function sayHello(){
alert('Hello');
}
and you put this in your app's assets/js
folder as a custom library assets/js/my-js-library.js
Then, finally, you refer to it from the index.html
like this:
<script src='http://example.com/assets/js/my-js-library.js'></script>
What does it take in typescript ( say in ngOnInit for example ) so you can do something like this?
ngOnInit () {
sayHello();
}
Or is it not possible?