I have a selectbox and in that selectbox whenever the user selects one destination I load a new page inside span with the class name "airlinename"
When my function runs I load that page, but it shows the innerhtml instead of showing angularjs that I loaded in that page.
How can I loaded page and post data?
Here is my first page code:
<body ng-app="myApp" ng-controller="myCtrl" ng-init='rcity=[{ "name" : "Moscow", "id" : 1182348.0 }, { "name" : "tehran", "id" : 1203548.0 }, { "name" : "Singapore", "id" : 1188510.0 }, { "name" : "shiraz", "id" : 1211086.0 }, { "name" : "Baku", "id" : 1168993.0 }];airline=[{ "title" : "Azerbaijan Airlines" }, { "title" : "Emirates Airlines" }, { "title" : "Mahan Air" }, { "title" : "Qatar Airways" }, { "title" : "Iran Air" }, { "title" : "Turkish Airlines" }]'>
<form action="/" method="post" class="form_send">
<div>
<table>
<tr>
<td><dl class="dropdown dropdown11 left_dromdown cityname marg5">
<dt> <a href="javascript:void(0)" onclick="slidedropdown(this)"> <span class="hida">Destination</span> </a> </dt>
<dd>
<ul style="display: none;" class="RouteDate routedatesearch">
<li>
<_input type="text" ng-model="search1" />
</li>
<li
onClick="routesearchendcity(this);"
class="routecode_list"
ng-repeat="x in rcity | filter : search1"
data-id="{{x.id}}" ng-click="myFunction()">{{x.name}}</li>
</ul>
</dd>
</dl>
<span class="airlinename">
<dl class="dropdown dropdown11 left_dromdown marg5">
<dt> <a href="javascript:void(0)" onclick="slidedropdown(this)"> <span class="hida">airline</span> </a> </dt>
<dd>
<ul style="display: none;" class="RouteDate routedatesearch">
<li >
<_input type="text" ng-model="search2" />
</li>
<li
onClick="routesearchairline(this)"
class="routecode_list"
ng-repeat="x in airline | filter : search2">{{x.title}}</li>
</ul>
</dd>
</dl></span></td>
</tr>
</table>
<div class="clr"></div>
</div>
</form_>
<div class="PostCityId">
<input type="hidden" value="1182348" class="EndCityID">
</div></body>
Please tell why the successCallback function does not work.
Here is my function:
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
$scope.cfdump = "";
$scope.myFunction = function() {
var request=$http({
method: 'post',
url: '/test-js.bc',
}).then(function successCallback(response) {
$(".airlinename").empty().html($compile(response)($scope));
},
function errorCallback(response) {});
}
});