title: if else condition inside function in controller - angularJS
body: <p>Still new to angular</p>
  
  <p>How to do a if else condition inside the function $scope.change in the controller</p>
  
  <p>I want to do it like this of $scope.SomeValue == 1 then  $scope.fn1() should get execute, if $scope.SomeValue == 2 then $scope.fn2 else $scope.fn3.</p>
  
  <p>I have tried traditional if else, app still works but takes default values defined in the last function as soon as i change an dynamic value through slider or input box</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;input type="radio" ng-model="SomveValue.value" name="a" value="1" ng-click="fn1()"&gt;
  &lt;input type="radio" ng-model="SomveValue.value" name="a" value="2" ng-click="fn2()"&gt;
  &lt;input type="radio" ng-model="SomveValue.value" name="a" value="3"&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>$scope.Somevalue = {
   value: 1
  }
  $scope.fn1 = {
    // Some Code
  }
  $scope.fn2 = {
    // Some Code
  }
  $scope.fn3 = {
    // Some Code
  }
  $scope.change = {
    $scope.fn1();
    $scope.fn2();
    $scope.fn3();
  }
  </code></pre>