IT/meteor

[미티어] rendered 에서 jquery 호출

generator 2017. 7. 6. 08:44

rendered 호출시 그냥 jquery 문을 넣고 호출을 했더니 계속 씹혔다.


해결 방법은 두가지


1.

Template.commentSubmit.rendered = function() {
if(!this._rendered) {
//$('#comment').hide();
console.log('Template onLoad');
}
}


2.

Template.commentSubmit.rendered = function() {
Meteor.defer(function(){
$('#comment').hide();
console.log('Template onLoad');
});
}