- Ember.HTMLBars._registerHelper('plugin-outlet', function(params, hash, options, env) {
- const connectionName = params[0];
-
- if (!_connectorCache) { buildConnectorCache(); }
-
- if (_connectorCache[connectionName]) {
- const childViews = _connectorCache[connectionName];
-
- // If there is more than one view, create a container. Otherwise
- // just shove it in.
- 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], viewInjections(env.data.view.container), options, env);
-
- const cvs = env.data.view._childViews;
- if (childViews.length > 1 && cvs && cvs.length) {
- const inserted = cvs[cvs.length-1];
- if (inserted) {
- childViews.forEach(function(cv) {
- inserted.pushObject(cv.create());