Print Var in JsFiddle

后端 未结 12 1636
眼角桃花
眼角桃花 2020-11-30 16:18

How would I print something to the result screen in JsFiddle from my JavaScript. I can\'t use document.write(), it doesn\'t allow it, neither print

12条回答
  •  爱一瞬间的悲伤
    2020-11-30 16:35

    Just to add something that might be useful to some folks....

    If you add the debugger console as shown above, you can access the scope by executing this:

    scope = angular.element(document.querySelector('[ng-controller=MyCtrl]')).scope();

    I find inspecting the scope directly easier than console.log, alert(), etc.

提交回复
热议问题