adopted-ember-addons / adopted-ember-addons/ember-metrics
Metrics adapters no longer inject services.
- Ngôn ngữ chính
- TypeScript
- Star
- 367
- Fork
- 158
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I have a few custom adapters in my application that depend on injected services.
I've updated my app to use ember-metrics 2.0.0-beta.2 and am now seeing this error in the console when running the app:
> Uncaught (in promise) Error: Assertion Failed: Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.
Proposing this change to the metrics service to fix this:
```
/**
* Instantiates an adapter.
*
* @method _activateAdapter
* @param {Object}
* @private
* @return {Adapter}
*/
_activateAdapter({ adapterClass, config }) {
const adapter = new adapterClass(config);
setOwner(adapter, getOwner(this));
adapter.install();
return adapter;
}
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.