У меня есть дочерний компонент, который получает значение атрибута от родительского компонента с помощью директивы @Input. проблема заключается в том, что двусторонняя привязка данных не работает с этим входным атрибутом. Любая идея, что может быть причиной этого?
класс дочерних компонентов
@Component({
selector: 'app-edit-property',
templateUrl: './edit-property.component.html',
styleUrls: ['./edit-property.component.css']
})
export class EditPropertyComponent implements OnInit {
@Input() property: any;
constructor(
private propertiesService: PropertiesService
) { }
ngOnInit() {
}
}
шаблон
<input type="text" class="form-control" required name="title" [(ngModel)]="property.title" #title="ngModel">
родительский компонент
<app-edit-property [property]='property'></app-edit-property>