Create the routes as described here .
Set up your app-routing.module.ts
(or just put it in app.module.ts
), put <router-link>
in your app.component.html
.
Now, to open a new window from the main page (or any other sub-items that you created), just call the function processed in the main component, which will point to the URL of the subcomponent route that you are setting for the new window.
Fragment example:
application-routing.ts
import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { MainComponent } from './main/main.component';
app.component.html
<router-outlet> <template ngbModalContainer></template> </router-outlet>
main.component.html
<button (click)="testMe()">myLabel</button>
main.component.ts
public testMe() { window.open( "openJcl" ); }
source share