Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute checked is always set to true #60

Closed
morkro opened this issue Jun 1, 2017 · 5 comments
Closed

Attribute checked is always set to true #60

morkro opened this issue Jun 1, 2017 · 5 comments

Comments

@morkro
Copy link

morkro commented Jun 1, 2017

Hey, great component here! 馃憤

I am trying to get the checked attribute to work for quite some time now, and looking at the source code it doesn't seem to be implemented?

The value is static and there is also no @Input() applied? Maybe I am getting this completely wrong, but no matter what I try the checked attribute always falls back to true.

@webcat12345
Copy link
Owner

@Input() is implemented here .

And short demo for sync checked attribute here goes.

<ui-switch [checked]="cust" (change)="onChange($event)"></ui-switch>

<h2>{{cust}}</h2>

<button class="btn btn-primary" (click)="onSwitch()">Change</button>
  cust = false;
  onChange(event): void {
    console.log(event);
  }
  onSwitch(): void {
    this.cust = !this.cust;
  }

@morkro
Copy link
Author

morkro commented Jun 1, 2017

Thanks for the quick reply. You are right, it should actually work.
Guess my issue is somewhere else in my codebase. 馃

@webcat12345
Copy link
Owner

@morkro Please let me know when your issue is solved so I can close this issue. Thanks.

@morkro
Copy link
Author

morkro commented Jun 5, 2017

The issue has not been resolved for me. It seems like internally the values are correct, but somehow the .checked class is still applied to the element.

@webcat12345
Copy link
Owner

Reopen issue when you can provide example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants