From 79fe5b86127aade169f83d89dd48c634a5aafa03 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 9 Jun 2014 20:30:01 +0200 Subject: [PATCH] Fix: Form is initially not available in $scope. --- app/scripts/directives/nodeForm.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/scripts/directives/nodeForm.js b/app/scripts/directives/nodeForm.js index e6ca544..ea76bc5 100644 --- a/app/scripts/directives/nodeForm.js +++ b/app/scripts/directives/nodeForm.js @@ -81,8 +81,7 @@ angular.module('ffffng') var submitted = false; $scope.hasError = function (field) { - var input = $scope.nodeForm[field]; - return input.$invalid && submitted; + return $scope.nodeForm && $scope.nodeForm[field].$invalid && submitted; }; var duplicateError = {