I'm getting dynamic data from ajax call which I want to append to a div container with the results from the call but the div is not rendered for some reason.
This is what I have, in the controller:
$http({
method: 'GET',
url: '/Search/SearchParts',
params: { id: id, packageid: $scope.packageid, searchterm: item.SearchValue }
}).success(function (data) {
$scope.searchresults = data;
});
And then in the html I have this:
<modal title="Search for parts" visible="showSearchForm">
<div class="container">
<div class="col-xs-4">
<div class="row">
Enter Search Criteria:
<input type="text" ng-model="item.SearchValue"
class="form-control"/>
</div>
<div class="row">
<button ng-click="searchPart(item)"
class="btn btn-success pull-right">Search Part</button>
<input type="hidden"
ng-model="$scope.packageid"
id="hfVehiclePackageIdSearchPart"/>
</div>
<div class="row" data-ng-repeat="result in $scope.searchresults">
<label>{{result.linecode}}</label>
</div>
</div>
</div>
</modal>
The last div which has ng-repeat with the data is not being rendered.
Any idea what am I doing wrong?
$scope.searchresults? can you provide the data ?