mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Set owner on raw views (#9624)
This allows things like `Ember.inject.service` to be used within the raw view. setOwner simply sets one property on the object, and the result is cached along with the other injected properties, so this should have negligible performance impact.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { registerUnbound } from "discourse-common/lib/helpers";
|
||||
import { findRawTemplate } from "discourse/lib/raw-templates";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import { setOwner } from "@ember/application";
|
||||
|
||||
let _injections;
|
||||
|
||||
@@ -16,6 +17,7 @@ function renderRaw(ctx, container, template, templateName, params) {
|
||||
session: container.lookup("session:main"),
|
||||
topicTrackingState: container.lookup("topic-tracking-state:main")
|
||||
};
|
||||
setOwner(_injections, container);
|
||||
}
|
||||
|
||||
if (!params.view) {
|
||||
|
||||
Reference in New Issue
Block a user