You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Do you want to request a feature or report a bug?
I am reporting a bug.
What is the current behavior?
When using a component in angular 1.5.8 I am able to inject $element into the component controller. It works fine running in the browser. But when used in testing the $componentController's DI errors with unknown provider $elementProvider.
What is the expected behavior?
I Expect it to work in test or in the app.
What is the motivation / use case for changing the behavior?
The behavior is inconsistent.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
1.5.8
Chrome
The text was updated successfully, but these errors were encountered:
$element, $attrs and $scope are locals that are injected into the controller. Even when using a compiled template, they are not fetched by the di. So when you call your $componentController, simply add them in the "locals" argument: `$componentController('name', {$element: yourjqLiteWrappedElement, $attrs: ...})
Note: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
I am reporting a bug.
What is the current behavior?
When using a component in angular 1.5.8 I am able to inject $element into the component controller. It works fine running in the browser. But when used in testing the $componentController's DI errors with unknown provider $elementProvider.
What is the expected behavior?
I Expect it to work in test or in the app.
What is the motivation / use case for changing the behavior?
The behavior is inconsistent.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
1.5.8
Chrome
The text was updated successfully, but these errors were encountered: