Popup window external link

2019-09-14 23:09发布

问题:

For some time I have been using http://angular-ui.github.io/bootstrap/ Modal for showing modal popup, I have found out that I can load external url (templateURL) to this view. But the problem is that loading takes about 3-4 seconds.

I need to load external content to modal popup and I can't find any fast/well working way.

Popup is on Edit/Create button thats why loading content before pressing button is not good for me(would take forever to load 100-200records in iframes or so)

How can i reduce load time for angular bootstrap modal? Or maybe there is other way I could load my MVC view in modal?(I'm using mvc5 razor)

Example of my code:

<div ng-controller="ModalDemoCtrl">
<button class="btn btn-primary" style="height:50px; width:100px;" ng-click="open('new_tp')">Create</button>  
<p>
<div id="butplace"></div>
</p>                      
<div ng-controller="ModalDemoCtrl">

And new_tp:

if (size == "new_tp") {
    modalInstance = $modal.open({
        templateUrl: '/Transport/Create/',
        controller: ModalInstanceCtrl,
        size: size,
        resolve: {
            items: function () {
                return $scope.items;
            }
        }

    });