JSFiddle - React, Tailwind, and code Playground

by blashadow

HTML

<div ng-app>
    
    <div ng-controller='libreria'>
        
        Nombre Libro:<br>
        <input type="text" ng-model='nombre'/><br>
        
        Cantidad Libro:<br>
        <input type="text" ng-model='cantidad'/><br>
        <button ng-click='agregar()'>Agregar</button>
        
        <div>
            
            <ol>
                <li ng-repeat='item in libros'>{{ item.nombre }} - {{ item.cantidad }}</li>
            </ol>
            
        </div>
        
    </div>
       
</div>

<script>
    function libreria($scope){
        $scope.agregar = function(){
            $scope.libros.push({
                nombre:$scope.nombre,
                cantidad:$scope.cantidad
            })
        }
    
        $scope.libros = [];
    }
    
</script>