Ui_template | Data not shown in pop-up

Hello,
I want to show the popup screen data by combining the ui_template methods, but I couldn't get the data or the screen. I couldn't understand the reason.

<!DOCTYPE html>
<html lang="tr">

<head>
    <title>Duruşlar</title>

    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.3/angular.min.js"></script>

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous">
    </script>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap">
    <style>
        body {
            font-family: 'Roboto', sans-serif;
            background-color: #e0f7fa;
            color: #333;
            margin: 0;
            padding: 20px;
            position: relative;
            min-height: 100vh;
        }

        .header {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 20px;
        }

        .logo {
            position: absolute;
            top: 20px;
            left: 20px;
            width: 150px;
        }

        .page-title {
            font-size: 32px;
            font-weight: bold;
            color: #0077b6;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        th,
        td {
            padding: 15px;
            text-align: left;
            border-bottom: 5px solid #ddd;
            font-size: 25px;
        }

        th {
            background-color: #0077b6;
            color: white;
        }

        tr:nth-child(even) {
            background-color: #f0f4f8;
        }

        .form-select {
            width: 100%;
            padding: 10px;
            border-radius: 5px;
            border: 2px solid #ccc;
            font-size: 25px;
        }

        .btn-success {
            background-color: #0077b6;
            border: none;
            padding: 10px 20px;
            color: white;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
        }

        .btn-success:disabled {
            background-color: #ccc;
            cursor: not-allowed;
        }

        .nr-dashboard-theme .nr-dashboard-button .md-button {
            font-size: 23px !important;
        }
    </style>
</head>

<body ng-app="" ng-controller="MyCtrl">
    <div class="header">
        <img src="https://www.valfsan.com.tr/valfsan_logo.jpg" alt="Logo" class="logo">
        <div class="page-title">Aktif Duruşlar</div>
    </div>
    <table class="table-secondary">
        <thead>
            <tr>
                <th>Makine</th>
                <th>Başlangıç Zamanı</th>
                <th>Bitiş Zamanı</th>
                <th>Sebep</th>
                <th>Onay</th>
                <th>Detay</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="data in msg.payload" id="tr-{{data.ID}}">
                <td>{{data.WORKCENTER}}</td>
                <td>{{data.FAILURESTART | date:'dd.MM.yyyy HH:mm:ss'}}</td>
                <td>{{data.FAILUREEND | date:'dd.MM.yyyy HH:mm:ss'}}</td>
                <td>
                    <select class="form-select" ng-model="selectedReason">
                        <option value="" disabled selected>Bir sebep seçin...</option>
                        <option ng-repeat="item in msg.sebepler" value="{{item.STEXT}}">{{item.STEXT}}</option>
                    </select>
                </td>
                <td>
                    <button class="btn btn-success" ng-disabled="selectedReason === 'sebepsec' || !selectedReason" ng-click="selectedReason !== 'sebepsec' && send({payload: 'clicked', id: data.ID, aciklama: data.ACIKLAMA, selectedReason, time: data.FAILURESTART});">Onayla</button>
                </td>
                <td>
                    <button class="btn btn-info" data-bs-toggle="modal" data-bs-target="#detailModal" ng-click="showDetails(data)">Detay</button>
                </td>
            </tr>
        </tbody>
    </table>

    <!-- Modal -->
    <div class="modal fade" id="detailModal" tabindex="-1" aria-labelledby="detailModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="detailModalLabel">Duruş Detayları</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <p><strong>Makine:</strong> {{selectedData}}</p>
                    <p><strong>Başlangıç Zamanı:</strong> {{selectedData.FAILURESTART | date:'dd.MM.yyyy HH:mm:ss'}}</p>
                    <p><strong>Bitiş Zamanı:</strong> {{selectedData.FAILUREEND | date:'dd.MM.yyyy HH:mm:ss'}}</p>
                    <p><strong>Sebep:</strong> {{selectedReason}}</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Kapat</button>
                </div>
            </div>
        </div>
    </div>

    <script>

        var test = "Burak ee"
        
        function MyCtrl($scope) {

            



            // Tarihleri Date nesnesine çevirme işlemi
            $scope.msg.payload.forEach(function(data) {
                data.FAILURESTART = new Date(data.FAILURESTART);
                data.FAILUREEND = new Date(data.FAILUREEND);
            });

            // Detayları gösterme fonksiyonu
            $scope.showDetails = function(data) {
                $scope.selectedData = {{msg.payload}};

            };

            // Diğer controller kodları...
        }
    </script>
</body>

</html>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.