I have a component that looks like this:
export default Component.extend({
tag: 'my-tag',
ViewModel,
view,
events: {
inserted: function() {
console.log('this works!');
}
}
});
and will show 'this works!' in the console. I tried to guess other events such as 'resize', 'onresize', etc.. but none of them workded. How can I know for sure what are the possible events that will be triggered? somehow I know 'inserted' is available, but what about the rest?
Thanks
inserted
removed
and viewmodel listeners. Like {viewModel} propertyName
to listen for when propertyName changes
export default Component.extend({
tag: 'my-tag',
ViewModel,
view,
events: {
inserted: function(el) {
$(window).on('resize', function() {
console.log('this works too!!!');
});
}
}
});
$(window)…
part.. is that jQuery? this is a donejs project and I never imported jQuery… but it works, weird isn’t it?
npm ls jquery
to see which one is requiring it I think
npm ls jquery
shows this (that explains it):
├─┬ bootstrap-datepicker@1.6.4
│ └── jquery@3.2.1
├─┬ documentjs@0.5.0
│ └── jquery@1.11.3
└─┬ funcunit@3.3.0
└── jquery@1.11.0