“entrada angular” Respostas de código

conjunto de entrada variável angular

@Component({
    selector: 'my-component',
    template: '<h3> My component </h3>'
})

export class MyComponent {
    @Input()
    set name(str: string) {
        this.service.setName(str);
        console.log(str);
    }
}
Cautious Cicada

entrada angular

@Component({
  selector: 'bank-account',
  template: `
    Bank Name: {{bankName}}
    Account Id: {{id}}
  `
})
class BankAccount {
  // This property is bound using its original name.
  @Input() bankName: string;
  // this property value is bound to a different property name
  // when this component is instantiated in a template.
  @Input('account-id') id: string;

  // this property is not bound, and is not automatically updated by Angular
  normalizedBankName: string;
}

@Component({
  selector: 'app',
  template: `
    <bank-account bankName="RBC" account-id="4747"></bank-account>
  `
})
class App {}
simon caf

@input no angular

@Input() and @Output() give a child component a way to communicate 
with its parent component.

@Input() lets a parent component update data in the child component. 
@Output() lets the child send data to a parent component.

// Please click source link for more details
Tiny Coders

Respostas semelhantes a “entrada angular”

Perguntas semelhantes a “entrada angular”

Mais respostas relacionadas para “entrada angular” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código