dkhrunov / ngx-mfe

Angular library for working with micro-frontends in Webpack 5 and plugin ModuleFederation
https://www.npmjs.com/package/ngx-mfe
MIT License
22 stars 4 forks source link

This is not recognized on outputs #6

Closed hmendezm closed 2 years ago

hmendezm commented 2 years ago

I followed the steps in your example everything works except when I try to use this. This always is undefined.

HTML

  <ng-container *mfeOutlet="'targetarea/Settings';outputs: { okEvent: next};">
      </ng-container>

CODE BEHIND

  public next(e) {

    if (e.sucess) {
      that.nameStep = true;
    }
  }

Targetarea/Settings CODE

export class SettingsComponent implements OnInit, AfterViewInit {
  @Output() public okEvent = new EventEmitter();
....

  public continue() {
    const projectTypes = PROJECTTYPES;
    this.okEvent.emit({ sucess: true });
  }

}
hmendezm commented 2 years ago

Hi dkrunov,

I updated *mfeOutlet as following

<ng-container *mfeOutlet="'targetarea/Settings';outputs: { okEvent: next.bind(this)};">

dkhrunov commented 2 years ago

Hi dkrunov,

I updated *mfeOutlet as following

<ng-container *mfeOutlet="'targetarea/Settings';outputs: { okEvent: next.bind(this)};">

  </ng-container>

Hi, nice, I add this thing into the documentation, thanks!