0
私はこのようなメインページがあります。AJAXのAngular jsページ?
index.htmlを
<div id="ajaxContent"></div>
<button onclick="callAjax()">Click</button>
<script>
function callAjax() {
$.ajax({
type: "POST",
url: "angular.html",
data: data,
success: function (response) {
$("#ajaxContent").html(response);
}
});
}
</script>
そしてangular.html
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<script>angular.module("myApp").controller("myCtrl", function ($scope) {
$scopr.test="hello!";
});
</script>
<div ng-app="myApp" ng-controller="myCtrl">
{{test}}
</div>
が、AJAXによってロードは常にある "角度が定義されていない" と言うの後でをこれを行う方法はありますか?ありがとう。
返信いただきありがとうございます。実際にはindex.htmlページは私のものではなく、ページ内の.jsファイルインクルードを使用するものもありますし、上記の "index.html"のようなコンテンツをロードするajax関数を呼び出すことで、コンテンツのこの部分も動的になります。 – protoss
私はそれが本当に他の提案は、申し訳ありません、うまくいくつもりはないと思う、申し訳ありません。 –