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

Wrong code sample of $componentController in component guide #14091

Closed
@ptgamr

Description

@ptgamr

The guide at https://docs.angularjs.org/guide/component

It has an error (bellow)

describe('component: heroDetail', function() {
  var component, scope, hero;
    ....

  beforeEach(inject(function($rootScope, $componentController) {
    scope = $rootScope.$new();
    hero = {name: 'Wolverine'};
  }));

  it('should set the default values of the hero', function() {

    // $componentController is `undefined` here
    component = $componentController('heroDetail', {$scope: scope});

   ...
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions