First page Back Continue Last page Graphics
Filters
- Filters are an Angular feature that allows you to transform values by passing them through one or more transformations. Filters are placed in the "data-ng-bind" variable with pipe symbols between them (Unix Style).
- data-ng-bind="(data.Car.LEADER.Lap.Completed.Value | number:0)"
- The statement above uses the Angular Filter called "number". It takes one argument for the number of decimal places. It returns the number formatted according to the locale's required format, see Localization page. It's safer to place parentheses around these pipelines.
- SIMRacingApps provides additional filters as follows. There are more details in the JavaScript Documentation which can be accessed from the main menu.
- sraNumber - Same as "number", but allows an entire Data object to be passed so the UOM can be appended.
- sraDuration - Formats a double in seconds to the D:HH:MM:SS.MMM format. Accepts a Data object as well.
- sraLPad, sraRPad - Pads the value either on left or the right.
- sraHex - Formats value as in hexadecimal.
- sraRGB – Formats the value suitable for assigning to a style attribute, like color;
- sraCeil, sraFloor, sraRound – Are simply wrappers for the same JavaScript functions.
- sraDebug - A pass-through filter with a debugger break point set.