Skip to content

angular/on-watch error #231

Closed
Closed
@tossp

Description

@tossp

hi,guys
How do I fix this error?

Error Messages:

  131:7  error  The "$on" call should be assigned to a variable, in order to be destroyed during the $destroy event  angular/on-watch
  140:7  error  The "$on" call should be assigned to a variable, in order to be destroyed during the $destroy event  angular/on-watch
  145:7  error  The "$on" call should be assigned to a variable, in order to be destroyed during the $destroy event  angular/on-watch
  150:7  error  The "$on" call should be assigned to a variable, in order to be destroyed during the $destroy event  angular/on-watch

Corresponding Source:

      $rootScope.$on('$stateChangeStart', function (event, toState) {
        //$log.debug(1, '$stateChangeStart', event, toState, toParams, fromState, fromParams);

        handleHtmlId(toState);
        detachOnResize();
      });

      // initialized with 1 cause we came here with one $viewContentLoading request
      var viewContentLoading = 1;
      $rootScope.$on('$viewContentLoading', function () {
        //$log.debug(2, '$viewContentLoading', event, viewConfig);
        viewContentLoading++;
      });

      $rootScope.$on('$stateChangeSuccess', function () {
        //$log.debug(3, '$stateChangeSuccess', event, toState, toParams, fromState, fromParams);
        forceResizeTrigger = true;
      });

      $rootScope.$on('$viewContentLoaded', function () {
        //$log.debug(4, '$viewContentLoaded', event);
        viewContentLoading--;

        if (viewContentLoading === 0 && initialized) {
          debouncedRun();
        }
      });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions