inflearn logo
강의

講義

知識共有

アンギュラファイアベース完全征服 - PetStoreショッピングモールプロジェクト

섹션2 FireBase의 petList활용하기에서 에러나네요

380

idmahoro0695

投稿した質問数 3

0

설명대로 다운로드받은 폴더에서 복사하고

새로 생성한 프로젝트에 붙여넣기했는데 저도 저 위와 같은 오류문구가 나오네요

./src/app/services/item.service.ts:2:0-41 - Error: Module not found: Error: Can't resolve 'firebase/app' in 'C:\Users\jun\Documents\angular-08liter\angular-petlist\src\app\services'

./src/app/services/item.service.ts:3:0-27 - Error: Module not found: Error: Can't resolve 'firebase/database' in 'C:\Users\jun\Documents\angular-08liter\angular-petlist\src\app\services'

Error: src/app/classes/item.ts:2:5 - error TS2564: Property 'key' has no initializer and is not definitely assigned in the constructor.

2     key: string;

      ~~~

Error: src/app/classes/item.ts:3:5 - error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.

3     id: string;

      ~~

Error: src/app/classes/item.ts:4:5 - error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.

4     name: string;

      ~~~~

Error: src/app/classes/item.ts:5:5 - error TS2564: Property 'available' has no initializer and is not definitely assigned in the constructor.

5     available: boolean;

      ~~~~~~~~~

Error: src/app/item/item.component.html:4:27 - error TS2341: Property 'item' is private and only accessible within class 'ItemComponent'.

4       <input [(ngModel)]="item.id" placeholder="ID"/>

                            ~~~~

  src/app/item/item.component.ts:8:16

    8   templateUrl: './item.component.html',

      m               ~~~~~~~~~~~~~~~~~~~~~~~

    Error occurs in the template of component ItemComponent.

Error: src/app/item/item.component.html:4:27 - error TS2341: Property 'item' is private and only accessible within class 'ItemComponent'.

4       <input [(ngModel)]="item.id" placeholder="ID"/>

                            ~~~~

  src/app/item/item.component.ts:8:16

    8   templateUrl: './item.component.html',

                     ~~~~~~~~~~~~~~~~~~~~~~~

    Error occurs in the template of component ItemComponent.

Error: src/app/item/item.component.html:9:27 - error TS2341: Property 'item' is private and only accessible within class 'ItemComponent'.

9       <input [(ngModel)]="item.name" placeholder="Name"/>

                            ~~~~

  src/app/item/item.component.ts:8:16

    8   templateUrl: './item.component.html',

                     ~~~~~~~~~~~~~~~~~~~~~~~

    Error occurs in the template of component ItemComponent.

Error: src/app/item/item.component.html:9:27 - error TS2341: Property 'item' is private and only accessible within class 'ItemComponent'.

9       <input [(ngModel)]="item.name" placeholder="Name"/>

                            ~~~~

  src/app/item/item.component.ts:8:16

    8   templateUrl: './item.component.html',

                     ~~~~~~~~~~~~~~~~~~~~~~~

    Error occurs in the template of component ItemComponent.

Error: src/app/item/item.component.html:14:27 - error TS2341: Property 'item' is private and only accessible within class 'ItemComponent'.

14       <input [(ngModel)]="item.available" type="checkbox"/>

                             ~~~~

  src/app/item/item.component.ts:8:16

    8   templateUrl: './item.component.html',

                     ~~~~~~~~~~~~~~~~~~~~~~~

    Error occurs in the template of component ItemComponent.

Error: src/app/item/item.component.html:14:27 - error TS2341: Property 'item' is private and only accessible within class 'ItemComponent'.

14       <input [(ngModel)]="item.available" type="checkbox"/>

                             ~~~~

  src/app/item/item.component.ts:8:16

    8   templateUrl: './item.component.html',

                     ~~~~~~~~~~~~~~~~~~~~~~~

    Error occurs in the template of component ItemComponent.

Error: src/app/item/item.component.ts:34:9 - error TS2322: Type 'Item | undefined' is not assignable to type 'Item'.

  Type 'undefined' is not assignable to type 'Item'.

34         this.item = this.itemService.getItem(id);

           ~~~~~~~~~

Error: src/app/services/item.service.ts:4:27 - error TS2307: Cannot find module 'firebase/app' or its corresponding type declarations.

4 import * as firebase from 'firebase/app';

                            ~~~~~~~~~~~~~~

Error: src/app/services/item.service.ts:36:33 - error TS7006: Parameter 'snapshot' implicitly has an 'any' type.

36       this.itemList.on('value', snapshot => {

                                   ~~~~~~~~

Error: src/app/services/item.service.ts:37:27 - error TS7006: Parameter 'snap' implicitly has an 'any' type.

37         snapshot.forEach( snap => {

라고 나고있는데 진행이 안되고있어요

pwa Angular firebase

回答 1

0

nomad

안녕하세요?

여러 에러 메시지 중 아래를 보면 npm으로 firebase를 설치하셨는지 확인바랍니다.

Error: Module not found: Error: Can't resolve 'firebase/app'

0

idmahoro0695

넵 확인해보겠습니다. 감사합니다.

3-13 리텐션 과제 제출합니다!

0

56

2

[과제]1-9 피벗 테이블 만들어보기

0

63

2

cnt수를 구할 때 왜 user_pseudo_id 를 사용하나요?

0

60

2

최종 과제 제출합니다.

0

91

2

3-13 과제

0

87

3

'Canvas 설정과 배경 설정’ 부분에 대해 질문드립니다.

1

71

1

3-13 리텐션 과제 제출합니다

0

90

2

app logs 데이터로 쿼리 연습

0

93

2

[과제] 연습문제 쿼리 작성했습니다!

0

80

2

6-1. 강의 최종 과제 제출합니다.

0

99

3

3-13 리텐션 과제 제출합니다

0

161

3

3-13. 리텐션 연습과제 제출합니다.

0

134

4

'플러터 개발환경 세팅하기' 링크 클릭시, 악성 스크립트 설치 유도 페이지로 이동하니 조심하시길 바랍니다.

0

106

2

initializeApp 부분에 오류가 납니다.

0

300

1

오류가 납니다

0

253

0

9:12

0

338

2

6:45

0

245

1

2:16 질문

1

515

3

2:15 어디서 카피할 수 있나요?

1

276

1

구문 문의

0

245

2

소스코드를 찾지 못했습니다. 도움 부탁드립니다.

0

254

1

Angualr-Petstore 소스 위치를 알고싶습니다

0

199

1

Database에 petlist가 추가되지 않습니다

0

303

3

enviorenment.ts 파일에 강사님의 api 정보가 포함되어있는거 같습니다.

0

200

1