Отображение углового элемента области видимости в HTML - PullRequest
0 голосов
/ 10 мая 2018

У меня есть $scope.policyNumber в моем angularJS, который содержит value key, полученного из json, который должен отображаться в этом сегменте:

<div id="alert_failure" class="alert alert-danger alert-dismissible"
                    role="alert" style="display: none;">
                    <button type="button" class="close" data-dismiss="alert"
                        aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <strong>Snap!</strong> SourceID/s {{policyNumber}} is/are already present in OVERRIDE table.
                </div>

Мой пользовательский интерфейс отображает

Snap! SourceID / s уже есть в таблице OVERRIDE.

без возврата policyNumber.

Есть ли способ, которым это может быть достигнуто?

Функция JS :

$scope.submit = function(employees) {
                $http({
                    'url' : '/updateOverride',
                    'method' : 'POST',
                    'headers' : {
                        'Content-Type' : 'application/json'
                    },
                    'data' : $scope.employees
                }).then(function(employees) {
                    $scope.insertResult = employees.data;
                        var controllerMessage = $scope.insertResult;
                        var messageKey = 'result';
                        var result = controllerMessage[messageKey];
                        console.log(controllerMessage); 
                        if(result == "success"){
                        } else {
                            var dataKey = 'data';
                            var policyData = controllerMessage[dataKey];
                            $scope.policyNumber = policyData;
                            console.log($scope.policyNumber);
                        }
                        $("#alert_"+result).show()
                })
            };
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...