0
현재 비디오 자습서를보고 있는데 InvalidPipeArgument 문제가 있습니다. 제발 나를 가이드로 ionic 및 angularfire 초보자로 새로운 해요.AngularFire 4.0에서 anglefireobservable/anglefirelist ionic3 문제가 발생했습니다.
.TS 코드에서 볼 수 있듯이this is my HTML page
<ion-header>
<ion-navbar color="twitter">
<ion-title>
<!--<span style="background-color:red">Hello</span>World-->
<span color="twitter">Job Categories</span>
</ion-title>
</ion-navbar>
</ion-header>
<ion-content class="card-background-page">
<div>
<ion-row>
<ion-col>
<ion-input type="text" [(ngModel)]="newItem" placeholder="New Shopping item"></ion-input>
</ion-col>
<ion-col>
<button ion-button (click)="addJob()"> Add! </button>
</ion-col>
</ion-row>
<ion-list>
<ion-item-sliding *ngFor="let item of shoppingItems | async">
<ion-item>
{{item.value}}
</ion-item>
</ion-item-sliding>
</ion-list>
</div>
</ion-content>
and this is my ts page:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { JobListingPage } from '../job-listing/job-listing';
import { FirebaseServiceProvider } from './../../providers/firebase-service/firebase-service';
import { FirebaseListObservable } from 'angularfire2/database';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
shoppingItems: FirebaseListObservable<any[]>;
newItem = '';
constructor(public navCtrl: NavController, public firebaseService: FirebaseServiceProvider) {
this.shoppingItems = this.firebaseService.getJobCategories();
}
addJob() {
this.firebaseService.addJob(this.newItem);
}
}
and this is my firebase-service.ts page
import { AngularFireDatabase } from 'angularfire2/database';
import { Injectable } from '@angular/core';
//import { Http } from '@angular/http';
//import 'rxjs/add/operator/map';
/*
Generated class for the FirebaseServiceProvider provider.
See https://angular.io/guide/dependency-injection for more info on providers
and Angular DI.
*/
@Injectable()
export class FirebaseServiceProvider {
/*constructor(public http: Http) {
console.log('Hello FirebaseServiceProvider Provider');
}*/
constructor(public afd: AngularFireDatabase) {
}
getJobCategories() {
console.log("hi");
console.log(this.afd.list('/jobs/'));
return this.afd.list('/jobs/');
}
addJob(name) {
this.afd.list('/jobs/').push(name);
}
}
, getJobCategories 콘솔을 인쇄 않지만 유형으로 반환 할 수 없습니다 비동기와 uncompatible/다른가?
유형 관찰 가능한 <{} []이 질문에 대한 답을 제공하지 않습니다 속성 쿼리 유형 관찰 –
에없는 AngularFireList 입력하지 할당 할 수 있습니다. 충분한 [평판] (https://stackoverflow.com/help/whats-reputation)이 있으면 [모든 게시물에 주석 달기] (https://stackoverflow.com/help/privileges/comment) 할 수 있습니다. 대신, [질문자의 설명이 필요없는 답변을 제공하십시오] (https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- i-do- 대신). - [From Review] (리뷰/저품절 게시물/18233812) – robinCTS