In Angular templates, if the template has an undefined variable, it will fail.
Sample code below:
Controller:
angular.module('app').controller('MyCtrl', function($scope) {
});
And the view:
<div ng-controller="MyCtrl">
<p ng-click="doSomething()">{{ data }}</p>
<input type="text" ng-modal="input">
</div>
None of the variables will be interpolated because they do not exist in $ scope. The omitted ng-modal( un ng-model) attribute will fail. This is undesirable development behavior.
Is there a way to change this so that errors are thrown? I would be fine with the monkey patch solution for Angular for this.
source
share