2016-12-16 69 views
0

我試圖將我的「上傳器」模板插入到模態中。當「上傳者」模板不在那裏時,模式會出現,如果有另一個模板放在那裏,模式也會彈出。我錯過了什麼?我在做什麼錯,它無法找到uploader.html?一切都在同一個文件夾中。我拼寫檢查。我一直試圖跟隨流星廚師上傳https://themeteorchef.com/tutorials/uploading-files-to-amazon-s3流星 - 未捕獲錯誤:沒有這樣的模板:

謝謝!

HTML模式

<template name="profilePicModal"> 
<div class="modal fade"> 
    <div class="modal-dialog"> 
     <div class="modal-content"> 


      <div class="modal-body"> 


       {{> uploader}} 
      </div> 

      <div class="modal-footer"> 
       <button type="button" class="btn btn-default" data- dismiss="modal">Close</button> 
      </div> 

     </div> 
    </div> 
</div> 
</template> 

這裏是uploader.html

<template name="uploader"> 
<div class="upload-area"> 
    <form id="upload"> 
    <p class="alert text-center"> 
    <span>Click or Drag a File Here to Upload</span> 
    <input type="file"> 
    </p> 
</form> 
</div> 
</template> 

這裏是uploader.js

Template.uploader.events({ 
'change input[type="file"]' (event, template) { 
Modules.client.uploadToAmazonS3({ event: event, template: template }   ); 
    } 
    }); 

myModal.js

import 'uploader.html'; 
import 'uploader.js'; 
Template.profilePicModal.events({ 
'click #save': function(e) { 
    e.preventDefault(); 


}); 



    Modal.hide('profilePicModal'); 
} 


}); 

回答

0

您的myModal.js文件似乎不完整且格式錯誤。 你能解決它嗎?

您的個人資料是否是指MyModal模板? 確保tu使用您在HTML文件中定義的相同模板名稱。

+0

嗨Yann,謝謝!我修正了這一點。仍然不能悲傷地工作:( –

相關問題