Nebular with Angular, how to get the value of #Output from a component in a window - angular9

I have opened a component in NbWindow. I want to close it when the window component emits data. the control of opening and closing it should remain with the parent component from where it was called.
Example:
Parent calls window (with child component)
I fill the form in the child component and emit the data
Once the parent receives it, it closes the window
How to achieve this?

Related

Receiving undefined from input property

Ok so I'm trying to receive data from another component by calling the selector on the html file of the parent component like this:
<app-graphs [module]="module" hidden></app-graphs>
and in the child component i added the input property like this:
#Input() module: Module = new Module({});
but in the ngOnInit of the child component when i log the contents of the module i received from input it's always null/undefined. I put another console.log in the ngOnChanges and when i went back to the previous page it actually logged the content i was expecting. So it looks like its not loaded when i first try to use it. Can someone help me with this? It's not trowing any errors or anything, and the folders of the two components are in the same folder. I have no idea what to do
I'm on angular 13 btw
From this code you are trying to keep a default value for the input, But default value only comes into picture if parent component doesn't pass any value for property. Here parent component is initially passing the value undefined which overrides the default value.
To solve you have to do one of these:-
Initialize this component only when data is present.
Do your logic in ngOnChanges of child component so when value is available and you receive the change, you are able to perform your logic.

How to prevent reloading the ng-template when clicking on the panel (ngb-panel) in an accordion (ngb-accordion)

I have used an "ngb-accordion" and for every ngb-panel I have a separate component and I have loaded it in an ng-template. Every time when I'm opening a panel, the constructor and the ng-init methods of the relevant component are getting triggered. Is there any workaround to trigger these methods only once? I just want to load the accordion form controller values only once.

Open up a react component just below the clicked component

I Have a list in react which can take up any number of rows
I have to render a component just below the clicked list component
The wireframe attached shows the list
https://wireframe.cc/oAe7eQ
The second wireframe attached shows after the component is rendered
What should be the structure to achieve this
Here are the list of steps that could help you achieve it.
So you can create a Modal for each list element.
This independent Modal component gets called with onClick event handler attached to the List element.
On the click you pass the row data as props to this new sub component Modal.
Hope this helps.

How to tell if forms launched as child window

I have a form which has a button to launch a new form (to add new data, that can be selected in the parent window).
This child form can also be viewed as a parent window, what I want to do is add a Close button to this window but should only be visible if its a child window.
Does anyone know how I can detect if the window is a child window in VBA for MS Access?
You can use OpenArgs argument of the OpenForm method to pass a value to the form when it is opened as a child. Checking Me.OpenArgs will then give you the information you require.

CSS/ html pop up window, what is the best practice?

I have a web page and its contents need to be loaded from a pop up window. As an example, when you select options of the pop up window, selected options need to be loaded back to the main page. Can any one suggest me the technique to be used?
You can access the popup's functions and variables through the window object returned from open().
var popup = open("popup.htm");
You can access the parent page's functions and variables through the window object returned by window.opener. Once the user selects the options, notify the parent page by calling some function in the parent page:
opener.setOptions(1, 2, 3);