Feature: valueFormatting Method Passed Component Data
See original GitHub issueI’m submitting a … (check one with “x”)
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here
Sometimes the value passed to valueFormatting
might require access to the controller data. For example, if you need to indicate a ratio, and need the denominator, but the valueFormatting
method only passes the value for the numerator and nothing for the denominator. This would allow formatting for value 6 out of 20 as 6/20
. You can’t add /20
to units as they won’t align properly.
- Angular version: 4.x.x
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Format the value of a Ngx gauge chart to display a percentage
Can anyone explain how to use the valueFormatting function? I have attached the HTML code, data for the graph and snapshot of the...
Read more >Value formatting in keyvaluemap components - Retool Forum
Hi - I've written a transformer using JSON.stringify to nicely format a JSON object. But when it's passed to a Key Value Map...
Read more >Value Formatting: DevExtreme - JavaScript UI ... - DevExpress
Set the format UI component property to apply a predefined format. ... The value to be formatted is passed to the function as...
Read more >Element: <oj-chart> - Oracle
The SVG DOM that this component generates should be treated as a black ... enabled, The time value for each data item is...
Read more >ag-Grid Components: Cell Renderers
The same params that are passed to the cellRenderer function. init? ... 'Days of Air Frost' column uses the Component method to format...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
have you tried doing the binding in the component and just passing the bound function in the template? Not sure if that would improve it but it might.
Component:
then in template:
You need to bind the function like this
[valueFormatting]="customFunction.bind(this)"
Then you will have access to the controller’s properties and methods inside it.