Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

tests: Use dealoc(element) for elements created with $compile() #2250

@ThomasBurleson

Description

@ThomasBurleson

To address potential memory leaks within the Karma tests, use:

var $compile, scope, element;

afterEach(function() {
    dealoc(element);
  });

  function injectScopeAndCompiler() {
    return inject(function(_$compile_, _$rootScope_) {
      $compile = _$compile_;
      scope = _$rootScope_;
    });
  }

  function compileElement(inputHtml) {
    element = $compile(inputHtml)(scope);
    scope.$digest();
  }

Metadata

Metadata

Labels

needs: unit testsThis PR needs unit tests to cover the changes being proposed

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions