0
<tr ng-if="usernames.length" ng-repeat="user in usernames">
        <td><input type="radio" name="radio"  ng-model="form.currentPatient" value="{{user}}" id="{{user.id}}"></td>
            <td>{{user.firstname}} </td>
            <td>{{user.lastname}}</td>
            <td>{{user.address}}</td>
            <td>{{user.age}}</td>
        </tr>



    </table>
    <div>{{form.currentPatient}}</div>
   <button type="submit" value="View Profile" onclick="location.href('result.html' )">View Profile</button>

If I click on that radio button ,the corresponding json values should be redirect to the result page Please help me ......

Anik Islam Abhi
  • 25,137
  • 8
  • 58
  • 80
Meenu
  • 1
  • 1

1 Answers1

0

If not using routeprovider

You can create shared service or factory to store value and retrive in other pages.

If using routeprovider

You can bind JSON value in URl this way-:

window.location="#/result/firstname="+$scope.user.firstname+"&&lastname="+$scope.user.lastname+"&&age="+$scope.user.age; And You can access this value as $location.search()['firstname'], $location.search()['lastname'], $location.search()['age']

you can access this value as-:
$location.search()['firstname'] for firstname,
$location.search()['lastname'] for lastname and
$location.search()['age'] for age
you can add $location in function like as $scope .

  • The table will display values of searched user from json. I want to get only one row value from the table when I click the radio button ie.The details of particular user and that value should be redirect to another page... – Meenu Oct 30 '15 at 05:23
  • then $scope.getRadioBtnData=function(data){//then set the data appropriate url} – vijaybalans Oct 30 '15 at 06:01
  • If example $scope.ListJson have an search results.
    then $scope.getRadioBtnData=function(data){//then set the data to appropriate url}
    – vijaybalans Oct 30 '15 at 06:07