测试时如何访问组件控制器?

How to access component controller when testing?

我正在尝试将组件的一些测试放在一起。我有以下

describe(`selecting an item`, () => {
    let element, $scope;

    beforeEach(module('my-app'))
    beforeEach(inject(($compile, $rootScope) => {
        $scope = $rootScope;
        element = $compile(`
            <item-selector parent-id="pid">
            </item-selector>
        `)($scope)

        //call $ctrl.activate() on the component's controller
    }))

})

item-selector 的控制器有一个 activate() 方法。如何从我的测试中调用它? $scope 似乎没有任何参考。

let ctrl = element.controller('item-selector')