Skip to content
\n

https://stackblitz.com/edit/input-number-patch-control-value?file=src%2Fapp%2Fapp.template.html,src%2Fapp%2Fapp.component.ts

","upvoteCount":1,"url":"https://github.com/orgs/taiga-family/discussions/10404#discussioncomment-12236758"}}}

input number format on bind #10404

Discussion options

You must be logged in to vote

Hello!

Just patch control value with new number - it will be formatted automatically:

protected control = new FormControl(0.42);
// [...]
constructor() {
  this.serverRequest$.subscribe((x) => {
    this.control.patchValue(x);
  });
}

https://stackblitz.com/edit/input-number-patch-control-value?file=src%2Fapp%2Fapp.template.html,src%2Fapp%2Fapp.component.ts

Replies: 1 comment 18 replies

Comment options

You must be logged in to vote
18 replies
@nsbarsukov
Comment options

@vytautas-pranskunas-
Comment options

@nsbarsukov
Comment options

@waterplea
Comment options

@vytautas-pranskunas-
Comment options

Answer selected by nsbarsukov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants