select either file or textarea data with ng-click
<p>I want to select either file or entered data. i need to validate that but i failed. it takes must be either file or text data only with button click. please help me to solve this problem thanks in advance. <a href="http://jsfiddle.net/8g8Nz/693/" rel="nofollow">JSFiddle</a></p>

<p>i need if user entered both file and textarea text it shows error. user must select either file or textarea only. this is my requirement</p>

<p><strong>HTML:</strong></p>

<pre><code>&lt;form name="form" ng-app="app" ng-controller="Ctrl" &gt;
  Upload file: &lt;input type="file" id="file" /&gt;&lt;br/&gt;&lt;br/&gt;
  Enter text: &lt;textarea id="textarea" required&gt;&lt;/textarea&gt;
  &lt;br/&gt;&lt;br/&gt;
  &lt;button type="submit" class="btn btn-primary btn-large" ng-click="submitForm()"&gt;Submit&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<p><strong>JS:</strong></p>

<pre><code>var app = angular.module('app', []);
app.controller('Ctrl', function ($scope) {
    $scope.submitForm = function(){
    alert("hi");
    var string1 = document.getElementById('file').value;
    var string2 =document.getElementById('textarea').value;
    if (string1 == string2) {
        return true;
    }
    else {
        return false;
    }
  }
});
</code></pre>