Click here to Skip to main content
15,885,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello, everyone!

I’ve been looking for a long time and haven’t found anything like it. I want a function in typescript that when selecting a checkbox a text input appears next to it to enter numbers.

So far I have this, but when selecting a checkbox, the text input appears in all the others.

What I have tried:

Ionic tags:
HTML
<pre><button (click)="toggleShow()" type="checkbox" >show/hide</button>
<div *ngIf="isShown" class="row container-fluid"  id="divshow" >
Div Content
</div>


Typescript function:
TypeScript
isShown: boolean = false ; // hidden by default
toggleShow() {
this.isShown = ! this.isShown;
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900