Angular automatically puts form elements on the scope: $scope[formName]
, for example.
It appears my controller is running before this form has been established on the scope ($scope[formName]
is undefined).
Form is not present immediately, yet once you click the button, it is present: http://plnkr.co/edit/q3RJLfWWcZhm9Y6oQjy3?p=preview
Is there an event to listen to, or some way to wait until the form has loaded?
Would
$scope.$watch(formName, ...)
work?