$scope.isWysiwygValid = function(layout) { if(!$scope.formSubmitted) { return true; } return layout.length > 0; }