title: Using ternary operator how can i check value is from which $stateParams?
body: <p>I have conditional parameters on ui-router because I am using the same screen in different places in an app. I have to write logic to check which <code>$stateParams</code> value I have assigned to <code>paramId</code>. I have tried with <code>if</code> and <code>else</code>.</p>
  
  <p>Is there a better approach to achieve this task? </p>
  
  <pre><code>$scope.challengesDTO = {
      challengeTypeLkupCode: 'RA_CHLNG_TYP_PRC'
  };
  
  var paramId = $stateParams.processId ? $stateParams.processId : $stateParams.assessmentId;
  
  if ($stateParams.processId) {
      $scope.challengesDTO.challengeTypeLkupCode = 'RA_CHLNG_TYP_PRC'
  } else if ($stateParams.assessmentId) {
      $scope.challengesDTO.challengeTypeLkupCode = 'RA_CHLNG_TYP_RSKASES'
  }
  </code></pre>