JSFiddle - React, Tailwind, and code Playground

by Alan Doe

HTML

<div ng-app>
   <div ng-controller="shoppingCart">
    
    <div ng-repeat="item in items">
        <span>Name :  {{item.name}}</span>
        <span>Price : {{item.price}}</span>
        <span>Weight : {{item.weight}}</span>
        <input ng-model="quantity" type="text">
        </input>
        <span>Total : {{item.price * quantity}}</span>
       </div>
       <button ng-click="addItem">Add Stuf</button>
       
  </div>
    
</div>

JavaScript

function shoppingCart($scope)
{
    
    $scope.items = [{
        name : "zetta1",
        price : 50,
        weight : 300
    },
                    {
                        name : "phi",
                        price : 562,
                        weight: 50
                    }];
}

$scope.addItem = function()
{
    $scope.items.push({name : "alan", price : "invaluable", weight : "6.34 x 10^35"});
}