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
Description
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});
...
}
}