2016-05-25 7 views
0

私はマルチレベルの繰り返しアコーディオンを持っています。ページの読み込みでは、最初のアコーディオンのデータがバインドされます。レベル1のアコーディオンをクリックすると、一意のIDがActionメソッドに渡され、次のレベルのアコーディオンのデータがバインドされます。 このIDを渡すことができず、角度jsコントローラからActionメソッドを呼び出しています。誰でも私がここで間違っていることを示唆することはできますか?ここでCSHTML

<div id="itineraryAccordion" ng-repeat="itinerary in item.Itineraries"> 
<div> 
<a data-toggle="collapse" data-parent="#itineraryAccordion" href="#collapseItinerary" aria-expanded="false" class="collapsed" ng-bind="itinerary.Name" data-ng-click="GetSchedule(itinerary.Name)"></a> 
</div> 
<div id="collapseItinerary" class="panel-collapse collapse" aria-expanded="false"> 
<div class="box-body"> 
<div class="box-group" id="scheduleAccordion" ng-repeat="schedule in scheList"> 
<div> 
<a data-toggle="collapse" data-parent="#scheduleAccordion" href="#collapseSchedule" aria-expanded="false" class="collapsed" ng-bind="schedule.ScheduleName" > </a> 
</div> 

SCRIPT

myApp.controller('layoutController', function ($scope, $http) { 
$scope.GetSchedule = function (itineraryName, $scope, $http) { 
    alert("Itinerary Id is " + itineraryName); 
    $http.get("../SchedulePlan/GetSchedule?itineraryName=" + itineraryName).success(function (response) { 
     $scope.scheList = response; 
    }) 
}; 

は、私が警告()でitineraryNameを取得していますが、次の行、$ http.get()で働いていません。

答えて

0

これを試してください。あなたは$scope$httpサービスを機能させる必要はありません。

myApp.controller('layoutController', function ($scope, $http) { 
    $scope.GetSchedule = function (itineraryName) { 
    alert("Itinerary Id is " + itineraryName); 
    $http.get("../SchedulePlan/GetSchedule?itineraryName=" + itineraryName).success(function (response) { 
    $scope.scheList = response; 
    }) 
}; 
+0

私はそれを削除しました。それでも$ http.get()内には入っていません –

+0

'href ="#collapseItinerary "'フォームタグ –

+0

が無効なURLかもしれません! –

関連する問題