Questions tagged [angular2-databinding]
55 questions
1
vote
2 answers
Angular - Uncaught Error: Cannot assign to a reference or variable
I have an Angular 8 app.
app.component.html
But this is…

Kgn-web
- 7,047
- 24
- 95
- 161
1
vote
2 answers
Angular 2+ One way data binding from view target to data source
In my angular application, I have a element that allows a user to set a description value. I want that value to be acceccable in the Data Source. I got this to work using 2-way data binding, as shown below:
1
vote
0 answers
Data binding inside ngFor
I am working on a project, where I am getting questions from backend with multiple options. Now in one of question type - Multi choice grid question, we are trying to create view like this
for that in the html, I have written this code,
And the array…

sagarpat
- 11
- 5
1
vote
1 answer
Angular sub-component binding doesn't work
I'm trying to display message in sub-component using dependency injection.
Here is first.component.ts:
import { Component } from '@angular/core';
import { SecondComponent } from './second.component';
@Component({
selector: 'app-first',
…

tikonoff
- 113
- 6
1
vote
2 answers
Error during data binding: property is null
I have a component list and its child (component item).
I'm trying to pass information from list to item, but it seem data binding doesn't work because the object is null, even if i have (hope) correctly initialized.
This is the list component with…

Max Bertoli
- 614
- 5
- 25
1
vote
1 answer
How can i save selected item from dropdown list in angular 2
I need help with saving selected item from dropdown list.
Here is my code. With this code I can console.log selectedProject.id and selectedProject.name by button and function outData. But I can't show selectedProject.name in HTML by itself.
When I…

Sebastien
- 85
- 2
- 7
1
vote
2 answers
How to pass data from parent to child components?
I have this property in a child component:
@Input() submitButtonDisabled: boolean;
In the template of my parent component I set it via property binding using interpolation:

Fernando Costa
- 669
- 1
- 9
- 31
1
vote
2 answers
Angular2: How do you properly bind to nested data?
I have a component I'm going to use as a shell for multiple choice questions to load into. Here's how the component is set up so far
component
import { Component } from '@angular/core';
export class Answers{
id: string;
answer:…

Optiq
- 2,835
- 4
- 33
- 68
0
votes
1 answer
Angular 11, how to bind a new object in template, to component
When a user loads a different selection (object) from the option drop-down list, I would like to get the NEW object returned in the (change) function. But, it is returning the default object every time, even though the select changes correctly. …

TMR
- 87
- 2
- 13
0
votes
0 answers
Angular Bind variable to a hashmap with value of type string
I am trying to bind a variable which contains the date and time to a key value pair within Component A. I can see in the console the value of currentDate, but when I try to bind the variable to the value of key = currDate I get an error message…

Alan
- 79
- 11
0
votes
1 answer
How to access updated element after changing it using one way binding
I want to update content of a div using string interpolation and then access some properties of that div element immediately. how do i access an updated element?
In the below code snippet, how do i access updated properties of div element in…

barley
- 176
- 1
- 10