# Check check-box programmatically in Ionic2 TypeScript Application

**URL:** <https://forum.ionicframework.com/t/check-check-box-programmatically-in-ionic2-typescript-application/128370>\
**Category:** ionic-v3\
**Created:** [April 19, 2018, 5:12pm UTC](https://forum.ionicframework.com/t/check-check-box-programmatically-in-ionic2-typescript-application/128370 "2018-04-19T17:12:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lado](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@lado](https://forum.ionicframework.com/u/lado)\
**Post date:** [April 19, 2018, 5:12pm UTC](https://forum.ionicframework.com/t/check-check-box-programmatically-in-ionic2-typescript-application/128370/1 "2018-04-19T17:12:04Z")

</div>

I’m trying programmatically check `check-box` in `Ionic2` `Type Script` Application, here is my `page.ts` `this.checkCheckBox();` with `isChecked: boolean;` variable from `constructor` load by default:

```
  checkCheckBox()
  {
    this.isChecked = true;
  }

```

and `page.html`:

```
  <ion-item>
    <ion-label>Build</ion-label>
    <ion-checkbox [checked]="!isChecked" [(ngModel)]="build" ></ion-checkbox>
  </ion-item>

```

not sure what is wrong here, it is not checked

---

<div class="post-metadata">

**Author:** ![SigmundFroyd](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sigmundfroyd/32/111604_2.png) [@SigmundFroyd](https://forum.ionicframework.com/u/SigmundFroyd)\
**Post date:** [May 3, 2018, 9:26pm UTC](https://forum.ionicframework.com/t/check-check-box-programmatically-in-ionic2-typescript-application/128370/2 "2018-05-03T21:26:39Z")

</div>

You have the check box set to be checked when `isChecked` is false.

The other issue is that `[checked]` and `[(ngModel)]` don’t play well together, and so you should only have one of them.

---

<div class="post-metadata">

**Author:** ![lado](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@lado](https://forum.ionicframework.com/u/lado)\
**Post date:** [May 5, 2018, 8:33pm UTC](https://forum.ionicframework.com/t/check-check-box-programmatically-in-ionic2-typescript-application/128370/3 "2018-05-05T20:33:19Z")

</div>

@SigmundFroyd Thank you

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:39pm UTC](https://forum.ionicframework.com/t/check-check-box-programmatically-in-ionic2-typescript-application/128370/4 "2021-07-19T21:39:03Z")

</div>

Closed on July 19, 2021, 9:39pm UTC


