What Is Property Binding? Property binding allows you to define an element attribute values from the component and its one-way data binding and also you can only set the data from the component to the view. Example As – Parent Component class Is - import { Component , Input } from '@angular/core' ; @ Component ({ selector: 'parent-Component' , template: 'Its Comes from parent: {{InputTextUser}}' }) export class ParentComponent { @ Input () InputTextUser ; } And The Child Component Class Is - import { Component } from '@angular/core' ; @ Component ({ moduleId: module . UserId , selector: 'child-Component' , template: ` <parent-Component [InputTextUser]="txtUser"></parent-Component> <span [InputTextUser]="txtUser"></span> ` }) export class ChildComponent { txtUser = 'Anil' ; ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers