I am using angular 4 in visual studio code. I want to include a javascript function in my code .
home.component.html
<html>
<body>
<button onclick="myFunction()">Click me</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
</body>
</html>
But when i clicking on the button, then its showing error : "Uncaught ReferenceError: myFunction is not defined at HTMLButtonElement.onclick"