これについて読んだあと、ajaxを通して読み込まれたhtmlは私の角型アプリケーションにバインドされていないことを理解しています。私は1.000ものを試しましたが、角度を理解するために 'customers-invoice.html'を得ることはできません。どんなアイデアも高く評価されます。あなたは、この場合にng-include
ディレクティブを使用することができajax load()関数の後のAngularJSバインドスコープhtmlへ
<body ng-cloak ng-app="myApp">
<main id="main">
<div ng-controller='Ctrl'>
<a ng-click="openInvoice(data.invoiceRef)" class="btn">View</a>
</div>
</div>
</body>
var app = angular.module('myApp', []);
app.controller('Ctrl', function($scope, $compile) {
$scope.invoice = {}
$scope.openInvoice = function(ref) {
$scope.invoice.ref = ref;
var html = $('#main');
html.load('customers-invoice.html')
$compile(html)($scope);
}
}
私は最終的に角度の独自の方法を使用しているので、この解決方法を選択しました。おかげで – ClaraG