how to set value in text field in angularjs on row click -


i trying set value on text field when row click got value of row text not able set value on text field .

here concept

<li ng-click="rowclick(station)" class="item" ng-repeat="station in data.data | filter:stationcode :startswith">{{station.stationname+"-("+station.stationcode+")"}}</li> 

i right ng-click="rowclick(station)" event when row click .but need set value whatever selected ..so first type "b" character in text field here code http://codepen.io/anon/pen/kpkyzw

 $scope.rowclick=function(station){      $scope.stationcode=station.stationcode;           //  $scope.$apply();    } 

thannks

instead of giving stationcode, give search.stationcode model. problem scoping. stationcode setting in rowclick function not in same scope 1 expecting

see modified code: http://codepen.io/anon/pen/zgypwj

$scope.search.stationcode change made. initialised $scope.search = {};


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -