I am new to angular and cannot figure out how to log in console the value of 2 variables. As the result I get the undefined values of the variables. Why?
My html:
<form class="ui large form segment">
<h3 class="ui header">Add a link</h3>
<div class="field">
<label for="title" #newtitle>Title</label>
<input name="title">
</div>
<div class="field">
<label for="link" #newlink>Link:</label>
<input name="link">
</div>
<button (click)="addArticle(newtitle, newlink)" class="ui positive right floated button">
Submit Link
</button>
.comonent.ts:
addArticle(title: HTMLInputElement, link: HTMLInputElement): boolean{
console.log(`Adding article title: ${title.value} and link: ${link.value}` );
return false;
}