2

In Angular.js we usually call methods from HTML code, e.g. <a ng-click="fooCtrl.bar()">foo</a> (here using the Controller As syntax).

However no error is thrown if the bar() method is missing from fooCtrl. It is a source of multiple regression bugs, especially after code refactoring.

Do you know how to force Angular.js 1.3 to throw runtime errors on missing controller methods called from the view?

Seb
  • 618
  • 5
  • 11
  • 1
    it's about errors in expressions in the view at all (not about methods only). I am also interested to find solution how to debug view expressions in angular. – Akim Kelar Aug 05 '15 at 10:43
  • a related question that still doesn't solve mine: http://stackoverflow.com/questions/26227596/why-dont-angularjs-errors-in-the-html-show-up-in-the-console – Seb Aug 05 '15 at 11:35
  • 1
    This discussion states that it is not possible: http://stackoverflow.com/questions/21297108/angularjs-ng-click-silently-eats-errors – Seb Aug 05 '15 at 11:43

0 Answers0