Answers for "angular binding"

1

angular binding

<input [disabled]="condition ? true : false">
<input [attr.disabled]="condition ? 'disabled' : null">
Posted by: Guest on January-26-2021
1

Bidirectionnal model binding

content_copy
      
      <app-sizer [(size)]="fontSizePx"></app-sizer>
Posted by: Guest on December-17-2020
1

property binding angular documentation

// component.ts

    @Component({
      templateUrl: 'component.html',
      selector: 'app-component',
    })
    export class Component {
      name = 'Peter';

      updateName() {
        this.name = 'John';
      }
    }
        // component.html

    <p>My name is {{name}}</p>
    <button (click)="updateName()">Update button</button>
Posted by: Guest on June-30-2020
1

angular property binding

// component.ts

    @Component({
      templateUrl: 'component.html',
      selector: 'app-component',
    })
    export class Component {
      name = 'Peter';

      updateName() {
        this.name = 'John';
      }
    }
Posted by: Guest on May-17-2020
0

angular property binding

import { Component } from "@angular/core";
@Component({
   selector: 'app-example',
  template: `
              <div>
              <input [value]='myText'></span>       
              </div>
              `
})
export class AppComponent {
  myText: string = "Hello World";
}
Posted by: Guest on November-17-2019

Browse Popular Code Answers by Language