Getting @Output event emitters from wrapped component in Window modal
- Dominant language
- TypeScript
- Stars
- 8.1k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
### Issue type
**I'm submitting a ...** (check one with "x")
* [ ] bug report
* [x ] feature request
### Issue description
**Current behavior:**
Currently, I can't seem to find a way to subscribe to (`@Output`) event emitters from the component passed into the window modal when it is being created, I can only pass in data through context but can't seem to find a way to subscribe to data passed from the wrapped component.
**Expected behavior:**
```.ts
// component being passed into the window service modal
class PassedInComponent {
@Output() onSomeAction = new EventEmitter();
@Input() text;
}
// component where the modal is being called
const windowModal = this.windowService.open(
PassedInComponent,
{ title: 'some title', context: { text: 'the-data' } },
);
windowModal.componentRef.instance.content.onSomeAction.subscribe((val) => {
// being able to subscribe to "onSomeAction" and get its data to use
console.log(val);
});
```
**Steps to reproduce:**
As described in the expected behaviour above
**Related code:**
```.ts
//
```
### Other information:
**npm, node, OS, Browser**
```
Node: v14.9.0,
npm: 6.14.8
OS: MacOS Catalina
Browser: Chrome
```
**Angular, Nebular**
```
Angular, Nebular Framework
```
Contributor guide
Assessment
This issue has not been assessed yet.