source : default.js

  1. 'use strict';
  2. /**
  3. * This is the NASCAR Analog Dash.
  4. *
  5. * <img src="../apps/NASCAR-Analog-Dash/icon.png" />
  6. *
  7. * @ngdoc apps
  8. * @name NASCAR-Analog-Dash
  9. * @param {boolean} showFPS When any value is seen in the URL for this attribute, the Frames Per Second(FPS) will be shown. Defaults to not show.
  10. * @author Jeffrey Gilliam
  11. * @since 1.10
  12. * @copyright Copyright (C) 2015 - 2024 Jeffrey Gilliam
  13. * @license Apache License 2.0
  14. */
  15. require(SIMRacingAppsRequireConfig,
  16. ['angular'
  17. ,'SIMRacingApps'
  18. ,'css!default'
  19. ,'widgets/AnalogGauge/Spek/Tachometer/Tachometer'
  20. ,'widgets/AnalogGauge/Spek/FuelLevel/FuelLevel'
  21. ,'widgets/AnalogGauge/Spek/OilTemp/OilTemp'
  22. ,'widgets/AnalogGauge/Spek/OilPressure/OilPressure'
  23. ,'widgets/AnalogGauge/Spek/Voltage/Voltage'
  24. ,'widgets/AnalogGauge/Spek/WaterPressure/WaterPressure'
  25. ,'widgets/AnalogGauge/Spek/WaterTemp/WaterTemp'
  26. ,'widgets/Gear/Gear'
  27. ],
  28. function( angular, SIMRacingApps) {
  29. angular.element(document).ready(function() {
  30. //create any angular filters, values, constants, directives here on the SIMRacingApps.module
  31. //your application controller is added as a controller on the SIMRacingApps module
  32. SIMRacingApps.module.controller("SIMRacingApps-Controller",
  33. ['$scope','sraDispatcher',
  34. function($scope, sraDispatcher) {
  35. //TODO: if you have any translations for your app, then uncomment the next 3 lines to load them.
  36. //Place them in a folder called "nls" and name each file with the pattern "text-{locale}.json"
  37. //{locale} should follow the same convention as the files in the ngLocale folder (i.e. ngLocale/angular-locale_{locale}.js).
  38. //Always provide a default translation file named "nls/text-en.json".
  39. //The format if these files are simply a json object that will get loaded into $scope.translations
  40. //or any variable of your choosing.
  41. sraDispatcher.loadTranslations("/SIMRacingApps/apps/NASCAR-Analog-Dash","text",function(path) {
  42. $scope.translations = sraDispatcher.getTranslation(path,"auto");
  43. });
  44. }]);
  45. //now start the process by passing in the element where the SIMRacingsApps class is defined.
  46. //all elements below that will be owned by SIMRacingApps. This should allow you to put other
  47. //content outside of this element that is not SIMRacingApps specific. All bundled apps will pass in the body.
  48. SIMRacingApps.start(angular.element(document.body),1280,480,16);
  49. //once angular is booted, your controller will get called.
  50. //it is not recommended to have multiple controllers in SIMRacingApps because of how the $scope is transversed from child to parent.
  51. //You can have as many directives and other angular objects as you wish.
  52. });
  53. });