@Kerui wrote:
below's my code in the file that caused the error
import { Component, OnInit } from '@angular/core' import { ToastController } from 'ionic-angular' import { Subject } from 'rxjs/Subject' import { Observable } from 'rxjs/Observable' import 'rxjs/add/operator/debounceTime' import 'rxjs/add/operator/distinctUntilChanged' import 'rxjs/add/operator/switchMap' import ApiService from '../../providers/api.service' @Component({ selector: 'page-my-playlists', templateUrl: './my-playlists.component.html' }) export default class implements OnInit { uid = new Subject<string>() playlists: Observable<{}> constructor( private toastCtrl: ToastController, private apiService: ApiService) { } ngOnInit() { this.playlists = this.uid .debounceTime(300) .distinctUntilChanged() .switchMap((uid: string) => this.apiService.playlists(uid)) } // private toastMessage(msg) { // this.toastCtrl.create({ // message: msg, // showCloseButton: true, // closeButtonText: 'Close', // position: 'bottom' // }).present() // } }when I run ionic serve:
but if I delete
@Component({ selector: 'page-my-playlists', templateUrl: './my-playlists.component.html' })no errors will occur
hope my poor english can be understand
Posts: 2
Participants: 1
