Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to load data in modal (ui.bootstrap.modal) with the help of angularJs.For Example i send request through post method and data retrieve successfully and now i want to load it into modal.Here is my code

var MainAdmin = angular.module('MainAdmin', ['ui.bootstrap']);
function MainAdminController($scope, $http, $modal) {
$scope.LoadTypesView = function() {
            $http({
                method  : 'POST',
                url     : 'load.php', 
                data    : dataArray,  
                headers : { 'Content-Type': 'application/json' }  
            })
                .success(function(data) {
                     if(data.result.status=="success")
                    {
                        $scope.Type = data.result.response; // Type is an array which is defined. 
$modal.open({
                            templateUrl: 'UserTypeModal.html',
                            backdrop: true,
                            windowClass: 'modal',
                            controller: function ($scope, $modalInstance, $log, Type) {

                                $scope.SubmitUserType = function () {

                                    $modalInstance.dismiss('cancel');
                                }
                                $scope.cancel = function () {
                                    $modalInstance.dismiss('cancel');
                                };
                            }
                        });
                    }   
                });
         };
}

Here is my HTML

<h1><a href="" ng-click="LoadTypesView()">Types</a></h1>

<script type="text/ng-template" id="UserTypeModal.html">
    <div class="modal-header">
        <h3>Define User Rights</h3>
    </div>
    <form ng-submit="SubmitUserType()">
      <div class="modal-body">

      </div>
    </form>
      <div class="modal-footer">
          <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
      </div>

</script>

Kindly provide some example code Thanks in advance

share|improve this question
    

1 Answer 1

try this way. It's just like a simple sample

<div ng-repeat="inventory in Type  ">
<p>{{inventory.YourField}}</p>
</div>
share|improve this answer
    
Thanks for you reply But i want this data to load into dialog box like link <div ng-repeat="inventory in Type "> <p>{{inventory.YourField}}</p> </div> –  Haseeb Feb 28 at 9:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.