javascript - Where are angular functions being "stored"? -


i not sure if following browser issue or bug however, if function following,

$scope.editsomething= function(){   alert("hello"); } 

gets called @ beginning , if edit something, webpage supposed (alert hello). however, breakpoint never reaches point except when load page.

my question: scope store functions? or debugger behaving weird?

$scope stores variables place on it.

variables can store functions. in case assigning anonymous function variable named editsomething.

the code inside controller executed each time controller initialized. if place breakpoint on line $scope.editsomething= function(){ hit breakpoint every time controller gets initialized (e.g. on page load).

if want see when anonymous method stored in editsomething variable executed (for instance placing ng-click=editsomething() on html element in template , clicking on it) should place breakpoint on alert("hello"); line.


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -