微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在帖子请求中将ForkJoin与地图一起使用-Angular 8

如何解决在帖子请求中将ForkJoin与地图一起使用-Angular 8

我有一个模块,可以发送许多请求,命令的顺序如下:

一个请求将保存大部分数据,并返回将在其他请求中发送的ID。 在我的.ts文件中:

  ngOnInit(): void {
    this.datosOferta = this.fb.group({
      ...
      domicilio_empleo: ['option1'],conocimiento: this.fb.array([]),experiencia: this.fb.array([]),});
   this.conocimiento.push(this.fb.control(null));
   .... // more data pushed to this 2 arrays + more data
 }

get conocimiento() {
    return this.datosOferta.get('conocimiento') as FormArray;
  }

save() {  
   let dataPost = {...this.datosOferta.value};
   this.service.save1(dataPost).subscribe((res: any)=>{
        if(res.result) {
          this.service.setId(res.id); 
          
         // **** I have 2 input arrays that need to do this map
          this.conocimiento.value.map( (x,idx) => {
            let _idiomaObj = {
              idOferta: this.service.id,idIdioma: this.datosOferta.controls.idiomaComponent.value[idx],idIdiomaCert: this.datosOferta.controls.certificado.value[idx],}
            this.service.save(_idiomaObj).subscribe( respuesta => {
              console.log(respuesta)
            })
          })

          this.service.anotherSave(data).subscribe( res => { console.log(res) }

          // if all are succes 
          this.router.navigate(['/next-page']);

我需要等到所有地图和其他功能成功结束后才能运行到下一页,但是我不确定如何将这张地图与ForkJoin混合使用,任何想法都非常受欢迎。

解决方法

类似

raise LinAlgError("SVD did not converge") LinAlgError: SVD did not converge

应该做好这项工作。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。