18910140161

HTML-我的愿望列表项显示源未知的问题-堆栈溢出

顺晟科技

2022-10-19 14:20:16

91

在页面上显示我的愿望列表项时出现问题。我使用的是Angular 10和JSON。温我点击添加到收藏夹它的颜色心和添加到我的json文件夹下的wishlistitem,但当我路由到页面看项目没有产品在那里。我可以告诉它击中了*NGFOR,因为每个项目的美元金额管道出现,但没有图像。当检查源时,它显示src=unknown。

我有两个文件夹wishlist-list和wishlistitem。我有一个wishlistitem服务,这是我认为我的问题所在。我已经包含了我的代码。

 import { Component, OnInit, Input } from '@angular/core';
 import {ProductService} from 'src/app/services/product.service'
 import { MessengerService } from 'src/app/services/messenger.service';
 import { WishlistService } from 'src/app/services/wishlist.service';
 import { WishlistItemService } from '@app/services/wishlist-item.service';
 import { Wish} from 'src/app/models/wish';
 import {Product} from 'src/app/models/product';


  @Component({
  selector: 'app-wishlist-list',
  templateUrl: './wishlist-list.component.html',
  styleUrls: ['./wishlist-list.component.scss']

})

导出类WishlistListComponent实现OnInit{

 import { Component, OnInit, Input } from '@angular/core';
 import {ProductService} from 'src/app/services/product.service'
 import { MessengerService } from 'src/app/services/messenger.service';
 import { WishlistService } from 'src/app/services/wishlist.service';
 import { WishlistItemService } from '@app/services/wishlist-item.service';
 import { Wish} from 'src/app/models/wish';
 import {Product} from 'src/app/models/product';


  @Component({
  selector: 'app-wishlist-list',
  templateUrl: './wishlist-list.component.html',
  styleUrls: ['./wishlist-list.component.scss']

ngoninit():void{

 import { Component, OnInit, Input } from '@angular/core';
 import {ProductService} from 'src/app/services/product.service'
 import { MessengerService } from 'src/app/services/messenger.service';
 import { WishlistService } from 'src/app/services/wishlist.service';
 import { WishlistItemService } from '@app/services/wishlist-item.service';
 import { Wish} from 'src/app/models/wish';
 import {Product} from 'src/app/models/product';


  @Component({
  selector: 'app-wishlist-list',
  templateUrl: './wishlist-list.component.html',
  styleUrls: ['./wishlist-list.component.scss']

}

 import { Component, OnInit, Input } from '@angular/core';
 import {ProductService} from 'src/app/services/product.service'
 import { MessengerService } from 'src/app/services/messenger.service';
 import { WishlistService } from 'src/app/services/wishlist.service';
 import { WishlistItemService } from '@app/services/wishlist-item.service';
 import { Wish} from 'src/app/models/wish';
 import {Product} from 'src/app/models/product';


  @Component({
  selector: 'app-wishlist-list',
  templateUrl: './wishlist-list.component.html',
  styleUrls: ['./wishlist-list.component.scss']

//这是我的wishlist-list html

 import { Component, OnInit, Input } from '@angular/core';
 import {ProductService} from 'src/app/services/product.service'
 import { MessengerService } from 'src/app/services/messenger.service';
 import { WishlistService } from 'src/app/services/wishlist.service';
 import { WishlistItemService } from '@app/services/wishlist-item.service';
 import { Wish} from 'src/app/models/wish';
 import {Product} from 'src/app/models/product';


  @Component({
  selector: 'app-wishlist-list',
  templateUrl: './wishlist-list.component.html',
  styleUrls: ['./wishlist-list.component.scss']

//这是我的wishlist项目服务

 import { Component, OnInit, Input } from '@angular/core';
 import {ProductService} from 'src/app/services/product.service'
 import { MessengerService } from 'src/app/services/messenger.service';
 import { WishlistService } from 'src/app/services/wishlist.service';
 import { WishlistItemService } from '@app/services/wishlist-item.service';
 import { Wish} from 'src/app/models/wish';
 import {Product} from 'src/app/models/product';


  @Component({
  selector: 'app-wishlist-list',
  templateUrl: './wishlist-list.component.html',
  styleUrls: ['./wishlist-list.component.scss']

}

 import { Component, OnInit, Input } from '@angular/core';
 import {ProductService} from 'src/app/services/product.service'
 import { MessengerService } from 'src/app/services/messenger.service';
 import { WishlistService } from 'src/app/services/wishlist.service';
 import { WishlistItemService } from '@app/services/wishlist-item.service';
 import { Wish} from 'src/app/models/wish';
 import {Product} from 'src/app/models/product';


  @Component({
  selector: 'app-wishlist-list',
  templateUrl: './wishlist-list.component.html',
  styleUrls: ['./wishlist-list.component.scss']

}

//以下是Wishlistitem

 import { Component, OnInit, Input } from '@angular/core';
 import {ProductService} from 'src/app/services/product.service'
 import { MessengerService } from 'src/app/services/messenger.service';
 import { WishlistService } from 'src/app/services/wishlist.service';
 import { WishlistItemService } from '@app/services/wishlist-item.service';
 import { Wish} from 'src/app/models/wish';
 import {Product} from 'src/app/models/product';


  @Component({
  selector: 'app-wishlist-list',
  templateUrl: './wishlist-list.component.html',
  styleUrls: ['./wishlist-list.component.scss']

ngoninit():void{ }

 import { Component, OnInit, Input } from '@angular/core';
 import {ProductService} from 'src/app/services/product.service'
 import { MessengerService } from 'src/app/services/messenger.service';
 import { WishlistService } from 'src/app/services/wishlist.service';
 import { WishlistItemService } from '@app/services/wishlist-item.service';
 import { Wish} from 'src/app/models/wish';
 import {Product} from 'src/app/models/product';


  @Component({
  selector: 'app-wishlist-list',
  templateUrl: './wishlist-list.component.html',
  styleUrls: ['./wishlist-list.component.scss']

顺晟科技:

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航