我正在开发使用Web API 2的Angular 2应用程序,它是在.NET Core 2.0中开发的。到目前为止,我的实施到目前为止没有任何问题。对于第一个实例单击事件web api消耗成功和任何刷新页面或仅针对此特定代码抛出错误启动相同周期
ERR_SPDY_PROTOCOL_ERROR
@Component({
selector: 'current-response-references',
templateUrl: './current-responses.template.html',
styleUrls: ['./current-responses.style.scss'],
providers:[
]
})
export class CurrentResponsesReferencesComponent implements OnInit {
private view: BehaviorSubject<ConsulationResponsesIdListDataModel>;
private consultationResponses: ConsulationResponsesIdListDataModel;
private responseCurrentState: ResponseCurrentStateDataModel;
constructor(private dataService: ConsultationResponsesListDataService,
private router: Router,
private session: SessionStorageService){}
ngOnInit(): void {
this.view = new BehaviorSubject<ConsulationResponsesIdListDataModel>(null);
this.consultationResponses = new ConsulationResponsesIdListDataModel();
this.loadData();
}
public loadData():void{
var consultationId = this.session.getItem('consultationId');
// following code believe causing error where similar code some else works fine
this.dataService.getConsultationResponsesList(consultationId)
.subscribe(data =>{
debugger;
this.view.next(data);
console.log("responses list ....", data);
});
}
this code is navigated from another component as
this.router.navigate(['modules/newResponseQuestions']);
...
@Component({
selector: 'new-response-questions',
templateUrl: './new-response-question.template.html',
styleUrls: ['./new-response-question.style.scss'],
encapsulation: ViewEncapsulation.None,
providers: [
]
})
export class NewResponseComponent implements OnInit {
constructor(
private router: Router,
private session: SessionStorageService){}
ngOnInit(): void {
}
是我遇到错误的组件的模板引用,请参阅上面的第一个代码块
<div class="card-block">
<current-response-references></current-response-references>
<questionsDetailList></questionsDetailList>
</div>