-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
false for attribute #280
Comments
What do you mean you do it in an event? Show me the code.
…On Nov 29, 2016 7:43 AM, "Frank Pimenta" ***@***.***> wrote:
When I have in the vm an attribute 'show' with default: true
it should be true
When I set it to false
It should be false
this scenario does not pass to me...
if I do: template.viewmodel.show(false) in an event the show attribute
does not change!
if I do it in the browser console (after logging the vm) it works.
is this a bug?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#280>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AED31j5q2Elcjuu0WtS3oss8PS211ns1ks5rDDoWgaJpZM4K_DKN>
.
|
Template.file.viewmode({
hasFile: false,
autorun() {
this.hasFile(!!this.data().file); // here it sets to true
},
events: {
'click a.delete-file'(event, template) {
event.preventDefault();
Meteor.call('deletefile', this.data().file._id, (err, response) => {
if(response) {
this.hasFile(false); // it does not set hasFile to false
} else {
// alert
console.log(err);
}
});
}
}
} |
Does it work without the autorun?
…On Nov 29, 2016 8:05 AM, "Frank Pimenta" ***@***.***> wrote:
Template.file.viewmode({
hasFile: false,
autorun() {
this.hasFile(!!this.data().file); // here it sets to true
},
events: {
'click a.delete-file'(event, template) {
event.preventDefault();
Meteor.call('deletefile>', this.data().file._id, (err, response) => {
if(response) {
this.hasFile(false); // it does not set hasFile to false
} else {
// alert
console.log(err);
}
});
}
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#280 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AED31tcKbkEB8HNZW3cgngcwMmGD0OmDks5rDD9IgaJpZM4K_DKN>
.
|
Yes. Manuel. It works fine. After trying it I found out it was my issue. Thank you for the support :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I have in the vm an attribute 'show' with default: true
it should be true
When I set it to false
It should be false
this scenario does not pass to me...
if I do: template.viewmodel.show(false) in an event the show attribute does not change!
if I do it in the browser console (after logging the vm) it works.
is this a bug?
The text was updated successfully, but these errors were encountered: