Возможности взаимодействия с рутовым приложением
Открытие в новой вкладке
Программно:
import { QEventsService } from '@diasoft/qpalette-visual';
constructor(private readonly qEventsService: QEventsService){
this.qEventsService.openNewTab({
caption: 'Название вкладки',
url: '/interface/service/component/route?query=param'
});
}
Декларативно:
<a [qLink]="['/interface/service/component/route?query=param']" qTabCaption="Название вкладки" target="_blank">
Откроется в новой вкладке
<q-icon icon="pi-external-link"></q-icon>
</a>
Не забудьте использоватьtarget="_blank"
.
Чтобы в своём компоненте получить параметры, нужно вовремя получить событие роутинга:
constructor(
private readonly activatedRoute: ActivatedRoute
) {
this.activatedRoute.queryParams
.subscribe((params) => {
console.log(params);
});
}
Закрытие вкладки
import { QEventsService } from '@diasoft/qpalette-visual';
constructor(private readonly qEventsService: QEventsService){
this.qEventsService.closeThisTab();
}
Изменение названия вкладки
import { QEventsService } from '@diasoft/qpalette-visual';
constructor(private readonly qEventsService: QEventsService){
this.qEventsService.updateTabCaption('Новое название');
}