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.

element.controller not working #11073

@samu

Description

@samu

We have the following test code:

$scope = $rootScope.$new()
element = angular.element("<div directive-under-test=''/>")
$compile(element)($scope)
controller = element.controller("directiveUnderTest")

As you can see, we want to access the directive's controller through element.controller. This works fine with angular v1.3.0-beta.11. However, when using v1.3.13, the result of that call is an empty object. Calling the method with an invalid directive name returns undefined. We use jQuery 1.11.1 too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions