Dynamic content in Angular 2
Denys Vuika

add() {
this.cakename = document.getElementById("demo").innerText;

<p id = "demo" > {{cakeMenu.caken}} </p>
<button id="page-button1" ion-button color="calm" block small
style="font-weight:600;" (click)="add()">

I want the data from json to be stored into variable into my .ts file.the console shows blank option.please help.

Show your support

Clapping shows how much you appreciated vishwajeet mane’s story.