我想测试将我发送到特定页面的方法。我检查了几个示例,所有示例都以与我相同的方式完成,但我收到错误:
预期间谍导航已被调用: [ '/themen' ] 但它从未被调用。错误:预期间谍导航已被调用:[ '/themen' ] 但它从未被调用。
我的html代码是:
<button class="arrow-back-icon kf-tooltip-btn align-middle" id="backButton"
tabindex="0" name="ic_arrow-back_24" (click)="goBack()">
</button>
Run Code Online (Sandbox Code Playgroud)
我的组件中的方法是:
import {AfterViewChecked, ChangeDetectorRef, Component, OnInit} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
import {SharingDataService} from '../services/sharing-data.service';
import {ActivatedRoute, Router} from '@angular/router';
import {BreakpointObserver} from '@angular/cdk/layout';
@Component({
selector: 'app-meeting',
templateUrl: './meeting.component.html',
styleUrls: ['./meeting.component.scss']
})
export class MeetingComponent implements OnInit, AfterViewChecked {
constructor(private readonly translate: TranslateService,
private readonly sharingDataService: SharingDataService,
private readonly router: Router,
private readonly activatedRoute: ActivatedRoute,
private readonly breakpointObserver: BreakpointObserver,
private …Run Code Online (Sandbox Code Playgroud)