vendredi 14 mai 2021

Displaying data from MongoDB in handlebars

I have two .hbs and one of them is a partial files, that particular partials contains variables to display data from the database.

This is index.hbs:

<!DOCTYPE html>
<html>
<head>
    <title> PayApp </title>
    <link href="https://fonts.googleapis.com/css?family=Roboto|Rubik&display=swap" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/css/index.css">
    <script src="https://code.jquery.com/jquery-3.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/js/index.js"></script>

</head>
<body>
    <div id="container">
        <h1> PayApp </h1>

        <div id="content">
            <form id="payment_form">
                <input type="text" name="name" id="name" class="field" placeholder="Name"> <br>
                <input type="number" name="refno" id="refno" class="field" placeholder="Reference Number"> <br>
                <input type="number" name="amount" id="amount" class="field" placeholder="Amount"> <br>
                <input type="button" name="submit" id="submit" value="SUBMIT">
            </form>

            <p id="error"></p>

            <!--
                TODO: Display all transactions here. Each transaction should be retrieved from the database and displayed through rendering `../partials/card.hbs`.
            -->
            <div id="cards">
                
            </div>
        </div>
    </div>
</body>
</html>

This is the partial card.hbs:

<div class="card">
    <img src="/images/icon.webp" class="icon">
    <div class="info">
        <p class="text">  </p>
        <p class="text">  </p>
        <p class="text"> Php  </p>
    </div>
    <button class="remove"> X </button>
</div>



Aucun commentaire:

Enregistrer un commentaire