2014-07-24 12 views
7

किसी कारण से मोडल बॉक्स ठीक काम करता है लेकिन यह मेरे द्वारा निर्दिष्ट किसी भी टेम्पलेट को लोड नहीं करता है।कोणीय-पट्टा मॉडल टेम्पलेट लोड नहीं करता

मेरे नियंत्रक के पास यह कोड है;

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

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

मेरा HTML इस तरह दिखता है;

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

और मेरा टेम्पलेट एक फ़ाइल में है और ऐसा लगता है;

<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> 

कोई त्रुटि नहीं है सब कुछ ठीक काम करने लगता है लेकिन टेम्पलेट लोड नहीं होता है। यदि मैं एक बिंदु पर कोणीय-पट्टा डीबग करता हूं तो टेम्पलेट लोड हो जाता है लेकिन फिर गायब हो जाता है और एक खाली मोडल छोड़ देता है।

उत्तर

0

bs मोडल विशेषता जोड़ने का प्रयास करें: देखने examples

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

अन्यथा डेटा टेम्पलेट जे एस का उपयोग किए बिना सीधे विशेषता का उपयोग मोडल को दिखाने के लिए:

<button type="button" class="btn btn-info" data-animation="am-fade-and-slide-top" data-template="app/rrn/searchBrn.html" bs-modal="modal"> 
    BRN Lookup 
</button> 

मुझे लगता है कि जब आप डाल bs-modal="modal" मोडल किसी भी तरह कोणीय-पट्टा पुस्तकालय में पूर्व परिभाषित है।

2

टेम्पलेट से ng-show="title", ng-bind="title" हटाएं।

+0

स्वीकार किए जाते हैं जवाब –

0

आप ng-show="title निकाल देना चाहिए ", ng-show="content" या ng-bind="title" टेम्पलेट से। आप यह सुनिश्चित करें कि टेम्पलेट अगर आप मॉडल शीर्षक दिखाना चाहते हैं नहीं ng-show

+0

होना चाहिए है बनाना चाहिए, कृपया एनजी को दूर -bind-एचटीएमएल = "शीर्षक" –

संबंधित मुद्दे