2017-10-05 9 views
0

나는이 위임에 다음 코드를 축약 한 후 타이프 라이터 오류 후 축소에서는

 $.ajax(this.validateURL, { 
     type: "post", 
     url: this.validateURL, 
     data: JSON.stringify(data), 
     contentType: "application/json; charset=utf-8", 
     dataType: "json", 
     success: function (response) { 
      solicitacion.procedure.set("GenarateSample", true); 
      if (!response.Success) { 
       notification.Show(response.Message, NotificationType.Error); 
       return false; 
      } else { 
       if (response.Message.length > 3) { 
        this.confirm(solicitacion); 
       } else { 
        this.adicionarprocedureNaGrid(solicitacion, false); 
       } 
       return true; 
      } 
     }, 
     error: e => { 
      error_handler(e); 
     } 
    }); 
:

<pre> $.ajax(this.validateURL, { 
    type: "post", 
    url: this.validateURL, 
    data: JSON.stringify(i), 
    contentType: "application/json; charset=utf-8", 
    dataType: "json", 
    success: i => t.procedure.set("GenarateSample", !0), 
    i.Success? (i.Message.length > 3 ? this.confirmarprocedure(t) : this.adicionarprocedureNaGrid(t, !1), !0) : (n.Show(i.Message, NotificationType.Error), !1), 
    error: n => { 
     error_handler(n) 
    } 
}) </pre> 

Whitout의 대표는, 축소를 올바른 것입니다 : 당신은 축약를 수행 할 필요가

 

    $.ajax(this.validateURL, { 
     type: "post", 
     url: this.validateURL, 
     data: JSON.stringify(i), 
     contentType: "application/json; charset=utf-8", 
     dataType: "json", 
     success: function (i) { 
      return t.procedure.set("GenarateSample", !0), 
       i.Success? (i.Message.length > 3 ? this.confirmarprocedure(t) : this.adicionarprocedureNaGrid(t, !1), !0) : (n.Show(i.Message, NotificationType.Error), !1) 
     }, 
     error: n => { 
      error_handler(n) 
     } 
    })
+1

당신은 화살표 기능을 의미합니까? ES2015에서는 지원되지 않습니다. 너는 그 변압기가 필요해. – Niladri

답변

0

이후 TypeScript 컴파일러가 작업을 완료했습니다.

타이프 스크립트 파일 (.TS)

const a = (y: string) => { 
    return y; 
} 

const b = function (y: string) { 
    return y; 
} 

자바 스크립트 (은 .js)로 컴파일은

var a = function (y) { 
    return y; 
}; 
var b = function (y) { 
    return y; 
}; 

그래서 컴파일 된 자바 스크립트가 아닌 타이프 라이터 소스 파일을 축소하세요 그리고 그것은 작동합니다.

+0

나는 시험 할 것이고, 지시 된 것과 비슷한 것을 수정할 것이다. –