반응형

TypeScript 6

tsc가 로컬파일에 대해 TS2307: Cannot find module을 슬로우합니다.

tsc가 로컬파일에 대해 TS2307: Cannot find module을 슬로우합니다. TypeScript를 사용한 간단한 예시 프로젝트가 있습니다.https://github.com/unindented/ts-webpack-example .tsc -p . 함께)tsc.8.. app/index.ts(1,21): error TS2307: Cannot find module 'components/counter'. components/button/index.ts(2,22): error TS2307: Cannot find module 'shared/backbone_base_view'. components/button/index.ts(3,25): error TS2307: Cannot find module 'share..

programing 2023.03.27

Visual Studio 코드 - 가져오기 견적 설정 조정

Visual Studio 코드 - 가져오기 견적 설정 조정 Visual Studio Code의 TypeScript에서 작업할 때 유형(스페이스 + 마침표로 트리거됨)에 대한 가져오기 제안이 큰따옴표를 사용하여 가져오기를 생성합니다. TypeScript 링터는 가능한 경우 작은 따옴표가 사용되는지 확인합니다. 아래 그림과 같이 제안에는 큰따옴표("@angular/..")가 있습니다.." Import 설정을 조정하려면 어떻게 해야 하나요?"typescript.preferences.quote Style" : "싱글" 자세한 내용은 다음을 참조하십시오. https://code.visualstudio.com/updates/v1_24#_preferences-for-auto-imports-and-generated-c..

programing 2023.03.27

Angular 컴파일러에는 TypeScript > = 3.4.0 이 필요하며, 대신 3.5.3 이 검출되었습니다.

Angular 컴파일러에는 TypeScript > = 3.4.0 이 필요하며, 대신 3.5.3 이 검출되었습니다. npm 빌드 실행 시 다음 오류가 발생합니다. Angular 컴파일러에는 TypeScript > = 3.4.0 이 필요하며, 대신 3.5.3 이 검출되었습니다. 저는 다음과 같은 것을 개별적으로 시도했습니다. npm install typescript@"> = 3.4.0 < 3.5.0" 입니다.그런 다음 node_modules 및 package.json을 삭제했습니다.npm 설치 실행 npm update --force.그런 다음 node_modules 및 package.json을 삭제했습니다.npm 설치 실행 에러가 아직 표시됩니다. 제 소포요.json에는 다음과 같은 종속성이 있습니다. "d..

programing 2023.03.22

'EventTarget' 유형에 'value' 속성이 없습니다.

'EventTarget' 유형에 'value' 속성이 없습니다. Angular 2 컴포넌트 코드에 TypeScript Version 2를 사용하고 있습니다. 아래 코드에 대해 "Property 'value' is not exist on 'EventTarget' type" 이라는 오류가 표시되는데, 해결 방법이 있을 수 있습니다.감사합니다! e.target.value.match(/\S+/g) || []).length import { Component, EventEmitter, Output } from '@angular/core'; @Component({ selector: 'text-editor', template: ` ` }) export class TextEditorComponent { @Output()..

programing 2023.03.17

전역 상수 정의

전역 상수 정의 Angular 1.x에서는 다음과 같은 상수를 정의할 수 있습니다. angular.module('mainApp.config', []) .constant('API_ENDPOINT', 'http://127.0.0.1:6666/api/') Angular(TypeScript 사용)는 무엇입니까? 모든 서비스에서 API base url을 반복하고 싶지 않을 뿐입니다.아래 변경 사항은 Angular 2 최종 버전에서 적용됩니다. export class AppSettings { public static API_ENDPOINT='http://127.0.0.1:6666/api/'; } 그리고 서비스에서는: import {Http} from 'angular2/http'; import {Message} fr..

programing 2023.03.17

'무엇이든' 대 '무엇이든'

'무엇이든' 대 '무엇이든' TypeScript 3.0에서는unknownWiki에 따르면 다음과 같이 입력합니다. unknown은 현재 삽입형이기 때문에 예약된 유형 이름입니다.의도한 미지의 사용에 따라 선언을 완전히 삭제하거나(새로 도입된 미지의 유형을 선호함) 다른 것으로 이름을 변경할 수 있습니다. 와의 차이점unknown그리고.any언제 사용해야 합니까?unknown에 걸쳐서any?에 대한 자세한 내용을 참조해 주세요.unknownPR 또는 RC의 발표에 기재되어 있습니다만, 그 요지는 다음과 같습니다. [..] 알 수 없는 것이 타입 세이프 대응물입니다.알 수 없는 것은 무엇이든 할당할 수 있지만, 알 수 없는 것은 유형 어설션이나 제어 흐름 기반의 협소화 없이는 그 자신이나 그 어느 것에도 할..

programing 2023.02.25
반응형