Friday, 9 December 2016

NG2- Default Checkbox true and change Checkbox selection values:

NG2- Default Checkbox true and change Checkbox selection values:
----------------------------------------------------------------



Ref:http://plnkr.co/edit/Hxy5Jz?p=preview

@Component({

 selector: 'my-app',

  providers: [],



 template: `
  <div>
 
 
      <input type="checkbox" [checked]="isAvailable" (change)="isAvailable = $event.target.checked">

     <pre>{{ isAvailable | json }}</pre>

    </div>
  `,

 directives: []
})


export class App {

 isAvailable = true;
 
constructor() {
   
  }

}

No comments:

Post a Comment

KISS, DRY, SOLID, YAGNI — A Simple Guide to Some Principles of Software Engineering and Clean Code

1 — KISS (Keep It Simple, Stupid)  Simplicity triumphs over complexity. Direct and clear codes are better for developing, maintaining, and s...