Hi ,
Could you please send the code for the angular js where i want to load the
data in div (which is working in my below code) . but after the load i want
to load another data with another get method and load this data on the
basis of the farekey in the respective div id (farekey) in the form of
span(which is dynamic)
Example
*<div id="6E-1" class="flights"><span>6E-1</span><span>indigo</span> ** <span>
1000</span>(this want to add dynamic on the second get method call)**</div>*
when second load of data i want to add another span on the basis of farekey
which is in second json data
*dynamic <span> 1000</span>*
suppose second json has
[{"Farekey":"6E-129",amt="1000"},{"Farekey":"6E-149",amt="2000"}]
var app = angular.module("MyApp", []);
app.controller("PostsCtrl", function ($scope, $http) {
$http.get('Details.php').
success(function (data, status, headers, config) {
$scope.posts = data;
//Data is
like
[{"RouteID":"DXB-LHR","Farekey":"6E-129","CarrierCode":"6E","airlineName":"IndiGo","an":"129","origin":"DEL","destination":"BOM","deptime":"17:55:00","arrtime":"20:10:00","srNo":1},{"RouteID":"DEL-BOM","Farekey":"6E-149","CarrierCode":"6E","airlineName":"IndiGo","airlineNumber":"149","origin":"DEL","destination":"BOM","deptime":"11:30:00","arrtime":"13:35:00","srNo":1}]
}).
error(function (data, status, headers, config) {
// log error
});
});
<body ng-app="MyApp">
<div ng-controller="PostsCtrl">
<div ng-repeat="post in posts" ng-show="post.srNo== '1'">
<div id='{{post.Farekey}}' style="border: solid 1px red;"
class="flights">
<span>{{post.Farekey}}</span>
<span>{{post.airlineName}}</span>
</div>
</div>
</div>
</body>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.