How can I use an event emitter on a dynamically added component?
<p>Working off of Eric Martinez' answer from <a href="https://stackoverflow.com/questions/34093670/angular-2-adding-removing-components-on-the-fly">Angular 2 - Adding / Removing components on the fly</a>, I want to limit the amount of components created. And then after deleting a component, I'm trying to emit that event to the parent so the parent knows the number of components currently created.</p>

<p>In this <a href="http://plnkr.co/edit/oLPyr1I9Y6YmYpHjfvXJ?p=preview" rel="noreferrer">Plunker</a>, I limit the number of components by 4, and then I'm trying to emit an event to lower that count back down. The event isn't emitting. How do you emit an event from a dynamically added component?</p>

<pre><code>// dynamic component
@Component({
    selector : 'dynamic',
    template : `
    &lt;div&gt;
        Component number {{_idx}} &lt;button (click)="remove()"&gt;Remove&lt;/button&gt;
    &lt;/div&gt;`
})
class DynamicCmp {
    _ref: ComponentRef;
    _idx: number;
    @Output lowerIndex = new EventEmitter&lt;any&gt;();
    remove() {
        this._ref.dispose();
        this.lowerIndex.emit(true);
    }
}

// Parent container component    
@Component({
    selector: 'my-app',
    template : `
        &lt;button (click)="add()"&gt;Add new component&lt;/button&gt;
        &lt;div #location (lowerIndex)="lowerIndex();"&gt;&lt;/div&gt;
    `
})
export class App {
    idx: number = 0;
    constructor(private _dcl: DynamicComponentLoader, private _e: ElementRef) {}

    lowerIndex() {
        this.idx--;
        console.log("subtracted");
    }

    add() {
        if (this.idx &lt; 4) {
            this._dcl.loadIntoLocation(DynamicCmp, this._e, 'location').then((ref) =&gt; {
            ref.instance._ref = ref;
            ref.instance._idx = this.idx++;
            });

            console.log("added")
        }
    }
}
</code></pre>

<p>I posted the components in here because stackoverflow requires code posted with plunker links. Code is exactly the same as seen in plunker </p>