Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery 'on' event is different while using Ember JS

While binding function to a html element using jQuery 'on', why callback function func having on attribute in Ember JS which is not available in JQuery.

jQuery Application:

$('body').append("<div id='div1'></div>")
var func = function(){alert("Ember")};
var bind = $("#div1").on("click",func);
"on" in func  // returns false

Ember Application

$('body').append("<div id='div1'></div>")
var func = function(){alert("Ember")};
var bind = $("#div1").on("click",func);
"on" in func // returns true
like image 665
user3705893 Avatar asked Nov 22 '25 16:11

user3705893


1 Answers

Could you please set false in EXTEND_PROTOTYPES in environment.js file. Please refer the below code snippets.You can achive this your output

var ENV = {
     ------
EmberENV: {
  FEATURES: {
    // Here you can enable experimental features on an ember canary build
    // e.g. 'with-controller': true
  },
  EXTEND_PROTOTYPES: false
}, 
like image 170
M K Avatar answered Nov 24 '25 08:11

M K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!