Giter VIP home page Giter VIP logo

ng-shopping-cart's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ng-shopping-cart's Issues

When import it says that aren't module or component of angular

Issue checklist

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request
  • Support request

Environment

Angular version: major.minor.patch
8.0.0

NgShoppingCart version: major.minor.patch
1.0.0

Browser: Name, Platform, Version

Platform: Name, Version

Node version: major.minor.patch
12.0.0

Current behavior

In a brand new project with Angular and added ng-shopping-cart with npm, when import it says that aren't module or component of angular
It seems that there aren't the decorator for components and module in the npm package.

I use a SharedModule for exporting all the modules or component necessary for other Modules/Components, and i use the Lazy Loading of Modules.

In my SharedModule when i import ShoppingCartModule tslint says that:

Class ShoppingCartModule is not an Angular module
image

Expected behavior

Steps to reproduce

Adding to quantity of item in cart

Issue checklist

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request
  • Support request

Environment

Angular version: 9.1.12

NgShoppingCart version: 1.0.0

Platform: Windows 10

Node version: 12.4.0

Current behavior

If I add an item to the cart, then try to add a different quantity of the same item, the cart item's quantity is updated to the new quantity.

Expected behavior

I would like to add to the quantity, not update.
eg I add an item to the cart. Then I add qty 2 of this item. I would expect to now have qty 3 in the cart.
How is this possible?

Steps to reproduce

Angular Universal error

Issue checklist

When we use the library with Angular Universal, Angular Universal doesn't work.

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request
  • Support request

Environment

Angular version: 10.1.4

NgShoppingCart version: 1.0.0

Current behavior

Angular Universal failed because the use of window without check if is the browser or not.

Expected behavior

Check if can use the variable window

Steps to reproduce

Create an angular project with angular universal using this library.

Loader or placeholder when load a value from LocalStorage

Issue checklist

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request
  • Support request

Environment

Angular version: major.minor.patch
8.0.0

NgShoppingCart version: major.minor.patch
1.0.0

Node version: major.minor.patch
12.0.0

Current behavior

Is possible to see a loader in the components when the data are loaded from LocalStorage?

I use this to load the number of total item in cart this.cartService.itemCount() but while the data are taken from LocalStorage i see nothing. Is possibile to show a loader or a placeholder in this fraction of time?

How can I get the current and detect quantity if it changed? any of item?

Issue checklist

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request
  • Support request

Environment

Angular version: major.minor.patch
7.2

NgShoppingCart version: major.minor.patch
1.0.0

Browser: Name, Platform, Version
Chrome 76.0.3809.100, Desktop
Platform: Name, Version
Windows
Node version: major.minor.patch
10.16

Current behavior

I'm not able to get the quantity of item and detect quantity when it changes.

Expected behavior

It should return the quantity in numbers and also emit the changes

Steps to reproduce

Resetting items in localStorage

Issue checklist

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request
  • Support request

Environment

Angular version: major.minor.patch
8.0.0

NgShoppingCart version: major.minor.patch
1.0.0

Browser: Name, Platform, Version

Platform: Name, Version

Node version: major.minor.patch
12.0.0

Current behavior

I've added the library in my angular project and work fine, but when i refresh the page the items values in localstorage are resetted, but the item in the array remain.

I've imported the module in the app module with root.

Expected behavior

Steps to reproduce

How can I remove tax rate? And/or change how it is applied when adding to cart?

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request
  • Support request

Environment

Angular version: major.minor.patch
8.0.1

NgShoppingCart version: major.minor.patch
1.0.0

Platform: Name, Version Windows 10

Node version: major.minor.patch
12.4.0

Current behavior

Product prices are tax exclusive, ie the tax is added based on current tax rate when an item is added to the basket.
Also it is not possible to remove the tax rate entirely.

Expected behavior

I would like to:
a) be able to hide the tax rate entirely in the cart-view (eg if not being used or zero rate), and
b) show the product prices as tax inclusive

Is this currently possible?

Steps to reproduce

Only ever one item added to the cart - even when I add multiple different items

Hi, even though I have multiple items in my test project which I am adding to the cart, it seems to overwrite them each time so there is always only the latest item. I have included the relevant code below. (It doesn't make any difference whether I catch the item added event and explicitly write to storage via the service or not). I have queried the items array via the service and it only ever has one item in it. It also doesn't matter whether I use local or session storage.

HTML

Card image cap
{{produce.name}}
${{produce.price}} per {{produce.measure}}

CLASS
import { Component, OnInit } from '@angular/core';
import {Produce} from './models/produce';
import {BaseCartItem, CartService} from 'ng-shopping-cart';

@component({
selector: 'app-shop',
templateUrl: './shop.component.html',
styleUrls: ['./shop.component.css']
})
export class ShopComponent implements OnInit {
produceArray = [];
constructor(private cartService: CartService) { }

itemAdded($event) {
console.log('item added called. Item = ', $event );
const item = $event;
this.cartService.addItem(item);
const items = this.cartService.getItems();
console.log('Items in care = ', items );

}
getBaseCartItem(index: number){
const selectedProd = this.produceArray[index];
let baseCartItem = new BaseCartItem();
baseCartItem.image = selectedProd.pictureURL;
baseCartItem.data = selectedProd.measure;
baseCartItem.name = selectedProd.name;
baseCartItem.price = selectedProd.price;
baseCartItem.quantity = selectedProd.quantity;
return baseCartItem;

}
ngOnInit() {
this.produceArray = [];
const skinProd = new Produce();
skinProd.pictureURL = '../assets/cremeNight.jpg';
skinProd.quantity = 10;
skinProd.name = 'Night Cream';
skinProd.price = 9;
skinProd.measure = 'each';

this.produceArray.push(skinProd);

const maizeProd = new Produce();
maizeProd.pictureURL = '../assets/maizeFlour.jpg';
maizeProd.quantity = 4;
maizeProd.name = 'Maize Flour';
maizeProd.price = 15;
maizeProd.measure = '250g';

this.produceArray.push(maizeProd);

const potProd = new Produce();
potProd.pictureURL = '../assets/potatoPontiac.jpg';
potProd.quantity = 12;
potProd.name = 'Pontiac potato';
potProd.price = 7;
potProd.measure = 'kg';
this.produceArray.push(potProd);

}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.