angularjs - Radio button selection in angular -


i working on radio buttons in angular. able populate radio button values server seems missing such small thing work on them properly.

html >>

 <label data-ng-repeat="milestonetype in question">       <input type="radio" name="milestonetype" data-ng-model="milestonetype.id" data-ng-value="true" data-ng-change="getmilestonetype(milestonetype.id)" />            {{milestonetype.type}}  </label><br /> 

script code >>

$scope.populatetype();  $scope.populatetype = function() {    $http.get(service_url + "project/getmilestonetype", {       params: {         "id": 0       }     })     .success(function(response) {       if (response.length < 1) {         $('#diverrorgrid').show();        } else {         $('#diverrorgrid').hide();         $scope.question = response;        }     })     .error(function(data) {       fnsuccessmodal("error in load", "error");     }); }  $scope.getmilestonetype = function(milestonetype) {    console.log(milestonetype);   if (milestonetype== "1") {      $scope.loadprojectmilestones();   } else if (milestonetype== "2")      $scope.loadcategorymilestones(); } 

list returned server :

id  title 2    project 3    category 

now want functionality work whenever user change radio button selection on interface. whenever user select "project" radio button loadprojectmilestones function called , if "category" radio button selected loadcategorymilestones function called. , based on selection , functionality work.

in other way, want if select project radio button milestonetype value should 2 , if select category radio button value should 3 (as in list above).

but not able functionality work properly.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -