问题
I am doing some testing on a product and I am attempting to edit one of my controller's scope functions (from Chrome Dev Tools) and then call this newly edited function either via the already-existing button that's set up to call it or via console. I'm having trouble with this though because my changes are not being picked up. I have been scouring SO for a couple hours but haven't been able to find a working answer yet. Is there a trick to refreshing a specific function (or possibly the controller itself) without reloading the page?
回答1:
You should be able to change the code from the Sources panel.
Add your new code...
And then press Command+S (Mac) or Control+S (all other OSs) to save. When there's an asterisk next to the file name, it means that your new code hasn't been applied.
来源:https://stackoverflow.com/questions/52434479/angularjs-edit-scope-function-from-dev-tools