"scope.$on('$destroy', function ()" not triggering when exiting back to main menu? (UI apps)

Discussion in 'Programming' started by danielr, Dec 23, 2020.

  1. danielr

    danielr
    Expand Collapse

    Joined:
    Jan 6, 2014
    Messages:
    69
    I was trying to get app settings saved (3rd example for the settings.json) https://documentation.beamng.com/content/apps/writing.html
    Code:
    scope.$on('$destroy', function () {
            StreamsManager.remove(streamsList);
            // [5] Optionally save the (possibly modified) app settings when done
            ctrl.saveSettings(appSettings);
          });
    It saves when changing levels for example, but not when exiting back to main menu or out of the game. Is that intended behaviour?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice