HTMLは、HTMLページに埋め込まれたHTMLページをサポートしていません。次の方法を使用してこの関数を実装してください。
1.AJAXの使用 - サーバーを呼び出して、対応するHTMLページを取得し、HTMLコントロールのinnerHTMLに設定します。
2。JSP、PHPなどのサーバー側のサーバーテクノロジーを使用して、動的ページにHTMLページを含める。
AngularJSを使用して、NGインクルード指令を使用して、1つのHTMLページに別のHTMLページを埋め込むことができます。
<div ng-app = "" ng-controller = "StudentController"> <div ng-include = "'main.html'"> </div> <div ng-include = "'subjects.html'"> </div>
例
tryangularjs.html
<html> <head> <title> Angular JSには</title> <style>テーブル、th、td {border:1px solid grey;国境崩壊:崩壊;パディング:5px;}テーブルTr:nth-child(odd){background-color:#f2f2f2;} table tr:nth-child(veven){background-color:#ffff;} </style> </head> <body> <h2> angularjsサンプルアプリケーション</h2> ng-include = "'main.html'"> </div> <div ng-include = "'subjects.html'"> </div> </div> <script> function sustentController($ scope){$ scope.student = {firstName: "mahesh"、lasts: "parashar"、parashar {name: 'physics'、marks:70}、{name: 'chemistry'、marks:80}、{name: 'math'、marks:65}、{name: 'englight'、marks:75}、{name: 'hindi'、marks:67}]、fullname:fultuns(){var duster(){fullname; StudentObject = $ scope.student; retund studentObject.firstname + "" + desudentObject.lastName; }};} </script> <script src = "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"> </script> </body> </html>main.html
<表> <tr> <td>名の入力:</td> <td> <入力タイプ= "text" ng-model = "desudent.firstname"> </td> </tr> <tr> <td>姓を入力:</td> <td> <入力タイプ= "text" ng-model = "sudunt.lastname"> </td> <td> {{student.fullname()}} </td> </tr> </table>subjects.html
<p>被験者:</p> <table> <tr> <th> name </th> <th> marks </th> </tr> <tr ng-repeat = "suduent.subjects"> <td> {{subject.name}}} </td> <td> {{subject.marks}} </td> </tr </table>出力
この例を実行するには、textangularjs.html、main.html、およびsubjects.htmlをWebサーバーに展開する必要があります。 Server URLを使用してWebブラウザでTextangularjs.htmlを開きます。結果を参照してください。
上記は、Angularjsに含まれる情報です。将来、関連する知識を整理し続けます。このサイトへのご支援ありがとうございます!