From 874b2a628d93333a5152656787e50e9e516a159c Mon Sep 17 00:00:00 2001
From: Robin Ward <robin.ward@gmail.com>
Date: Wed, 17 Jun 2015 11:09:19 -0400
Subject: [PATCH] FIX: `plugin-outlet` should do view injections

---
 .../discourse/helpers/plugin-outlet.js.es6       | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6 b/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6
index 18ae57fa1..fc385a449 100644
--- a/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6
+++ b/app/assets/javascripts/discourse/helpers/plugin-outlet.js.es6
@@ -99,6 +99,20 @@ function buildConnectorCache() {
   });
 }
 
+var _viewInjections;
+function viewInjections(container) {
+  if (_viewInjections) { return _viewInjections; }
+
+  const injections = container._registry.getTypeInjections('view');
+
+  _viewInjections = {};
+  injections.forEach(function(i) {
+    _viewInjections[i.property] = container.lookup(i.fullName);
+  });
+
+  return _viewInjections;
+}
+
 Ember.HTMLBars._registerHelper('plugin-outlet', function(params, hash, options, env) {
   const connectionName = params[0];
 
@@ -112,7 +126,7 @@ Ember.HTMLBars._registerHelper('plugin-outlet', function(params, hash, options,
     const viewClass = (childViews.length > 1) ? Ember.ContainerView : childViews[0];
 
     delete options.fn;  // we don't need the default template since we have a connector
-    env.helpers.view.helperFunction.call(this, [viewClass], hash, options, env);
+    env.helpers.view.helperFunction.call(this, [viewClass], viewInjections(env.data.view.container), options, env);
 
     const cvs = env.data.view._childViews;
     if (childViews.length > 1 && cvs && cvs.length) {