Angular directive

sra-data source

This directive is the most basic directive available. It simply subscribes to data from the server and updates $ with the values. When that happens, Angular is envolked, through watches, to update the DOM.

There are 2 ways to use all SIMRacingApps directives. You can either use them as a DOM Element, or an attribute to another DOM Element. You cannot add them as an attribute to other directives. Each directive is designed to take complete ownership of the DOM Element it is attached to.

Example as Element:

<sra-data data-sra-data="/Car/REFERENCE/Description" data-ng-bind="data.Car.REFERENCE.Description.ValueFormatted"></sra-data>

For detailed information on the available Data paths, see the SIMPlugin documentation. From that page, ignore the information about how to use it from Java, but look at the paths available. Click on them to get to the details about each path. Each Java method that supports paths has a "PATH = x" in the documentation.

Example as an attribute of an Element:

<div data-sra-data="/Car/REFERENCE/Description" data-ng-bind="data.Car.REFERENCE.Description.ValueFormatted"></div>

As you can see, there is not much difference in the two, but it does change how you will reference it in CSS.

If you pass in a function to call when this object is clicked, when clicked, the function is called with the $scope and value as arguments. This function can then use the setClickedState() and getClickedState() methods on $scope.

data-sra-data String The path to the SIM data.
data-sra-args-on-click String (Optional) function to call if this object is clicked