0
ディレクティブを作成しましたが、親スコープにアクセスしようとしています。SelectedItemChangeが起動せず、Test1の値にアクセスできません。ディレクティブから親スコープにアクセス
app.directive('driverNotes', function ($location) {
return {
restrict: 'E',
transclude: true,
templateUrl: "../HtmlTemplates/notesTempl.html",
controller: function ($scope, $http) {
console.log($scope.$parent.Test1);
$scope.SelectedItemChange = function(item) {
if (item != undefined || item != null) {
console.log(1);
}
}
}
}
});
指令テンプレート
<md-input-container class="notesTable" flex-gt-sm ng-disabled="userForm.$invalid" ">
<table class="notesTable">
<tr><th>Description</th><th>Date</th><th>Down</th><th>Premium</th><th>Date Updated</th></tr>
<tr ng-repeat="note in notesSearch">
</tr>
</table>
</md-input-container>
を使用する必要があります。ディレクティブテンプレートの外観はどうですか? – Dario
ありがとうございます。 – user6934713
の上にディレクティブテンプレートを追加しました。ディレクティブテンプレートの '$ scope.SelectedItemChange'はどこですか? –