Questions tagged [property-binding]

Property binding is the primary way of binding data in Angular. The square braces are used to bind data to a property of an element, the trick is to put the property onto the element wrapped in brackets: [property] .

Usage

  • This tag is intended for questions which ask about Angular Property Binding

Code Sample

Let's consider an example where we are binding the value property of the input element to a component's myText property.

import { Component } from "@angular/core";
@Component({
   selector: 'app-example',
   template: `
              <div>
              <h3 [value]='myText'></h3>       
              </div>
              `
})
export class AppComponent {
  myText: string = "Hello World";
}

Result:

Hello World


Asking a question

  • Mention you want to update/bind DOM elements to property in compoent.
  • Reduce your issue to a small example
  • Post a reduced working code on plnkr.co or stackblitz.com
  • If there's a bug (or some unintentional behavior), try to troubleshoot the problem. (If it's a bug report, please create a new issue at Angular's Github repository instead.)

Learn more

To learn more about Angular Material, visit the following resources to help you get started:

161 questions
0
votes
2 answers

How to use the *ngFor=let value as html property value in angular 2

Im trying to use the value of {{facturaCE.cantidad / 1.16}} as property value of data-clipboard-text = facturaCE.cantidad / 1.16 This is a fragment of my code {{facturaCE.cantidad}} -->…
Xaverius
  • 83
  • 1
  • 5
0
votes
0 answers

Angular 2 carousel

[UPDATE] I work with angular 2 carousel which is here: https://embed.plnkr.co/ScE0uqfd0ZvL6T9j1XjL/ I wanna add transition effect. In carousel-example ts I added property
Yuniku_123
  • 269
  • 1
  • 5
  • 18
0
votes
1 answer

Bidirectionally bind to property negation

Given DoubleProperty A; DoubleProperty minusA; is there a way to bind their negations bidirectionally to each other, so that A.get() == -minusA.get() at all times, and both can be set()?
0
votes
1 answer

JavaFX Update FlowPane after List Changes

So after my first ever assignment with JavaFX I was assigned a project of what I would consider massive proportions for only being my 2nd time with JavaFX. I had to create a photo album with basic functionality: add images, remove images, sort by…
Aly
  • 57
  • 1
  • 9
0
votes
1 answer

URL parameter as property binding

Is it possible to use a URL parameter as a property binding in UI5? My problem is that I want to have different OData collections placed in the same UI5 aggregation. For example let's say I've "/Car("Mustang")/parts" and "/Car("Whatever")/parts".…
OddDev
  • 3,644
  • 5
  • 30
  • 53
0
votes
1 answer

Javascript in either property binding or Query in Birt

Can I include javascript in the property binding Query Text field of a BIRT report Data Set? The reason why I want to do this is to select a query depending on a report parameter passed by the user.
Alan
  • 1,479
  • 3
  • 20
  • 36
0
votes
1 answer

bind a Control's property to another control's property value on the same form

I am working in C# 4.5 - Winform. My question is specific to C# WinForm. I want to bind a Control's property to another control's property value on the same form. I have a GroupBox and a Check Box. When Check box is checked then group box should be…
Haider Ali Wajihi
  • 2,756
  • 7
  • 51
  • 82
0
votes
1 answer

Use Property in UserControl

I've made a usercontrol and added a new property like this: public partial class MyControl : UserControl { public static readonly DependencyProperty SelectedBrushProperty; static MyControl() { SelectedBrushProperty =…
Groulien
  • 59
  • 6
0
votes
1 answer

Can an Ember Controller bind to changed events for it's own properties?

Given a controller like: App.SignInController = Ember.Controller.extend authenticated: false authenticatedDidChange: (() => console.log @get('authenticated') ).observes('controller.authenticated') This doesn't seem to work so I must not…
rmontgomery429
  • 14,660
  • 17
  • 61
  • 66
-1
votes
1 answer

C# WPF Binding DependencyProperty Not Working Textbox

I am creating placeholder in WPF textbox. I got code of hint in stackoverflow. Working code with static hint
Naitik Kundalia
  • 199
  • 1
  • 1
  • 19
-2
votes
2 answers

Angular 8 how to set background using [style]

I am learning angular to set style using angular way so I have create below code. I am trying to set background using below code - but its not working as expected. How to set background using below syntax with [style]? I am creating demo with…
bharat
  • 79
  • 1
  • 11
1 2 3
10
11