I am trying to retrieve a value from my view to controller.The value is generated at runtime.
<ng-option ng-repeat="w in details track by $index">
<div class="program-grid-row table-row" >
<div>
<a class= ng-click="setWork('hello')"
href="#/helloworls/{{w[5]}}">{{w[5]}}</a>
</div>
</div>
</ng-option>
I want to retrieve the value of w[5] at my controller such that controller.js
$http.get(Url +$scope.w[5]).then(function(response){
$rootScope.details= response.data;
});
Not sure how can we retrieve the value of w[5] at the controller. Pls help.
wfor all the iteration overdetails. and then what are you doing in$httpget ? Doesnt make any sense. Do you want to make that$httpcall insetWorkfunction ? so that a http request is made for theclicked<a href>