Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular-Strap Modal Does Not Load Template

For some reason the modal box works just fine but it does not load any templates I specify.

My Controller has this code;

var brnSearchModal = $modal({ scope: $scope, template: "app/rrn/searchBrn.html", contentTemplate: false, html: true, show: false });

$scope.showModal = function () {
    brnSearchModal.$promise.then(brnSearchModal.show);
};

My HTML looks like this;

<button data-ng-click="showModal()" type="button" class="btn btn-info" data-animation="am-fade-and-slide-top">
    BRN Lookup
</button>

And my template is in a file and looks like this;

<div class="modal" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" ng-show="title">
                <button type="button" class="close" ng-click="$hide()">&times;</button>
                <h4 class="modal-title" ng-bind="title">Hello, World!</h4>
            </div>
            <div class="modal-body" ng-bind="content">Lorem ipsum dolor.</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" ng-click="$hide()">Close</button>
            </div>
        </div>
    </div>
</div>

There is no error everything seems to be working fine but the template does not load. If I debug angular-strap at one point the template is loaded but then disappears in and leaves a blank modal.

like image 332
Lukasz Avatar asked Jul 24 '14 19:07

Lukasz


1 Answers

Remove ng-show="title", ng-bind="title" from the template.

like image 159
dcdrns Avatar answered Oct 23 '22 21:10

dcdrns