O HTML não suporta páginas HTML incorporadas em páginas HTML. Implementar esta função usando os seguintes métodos:
1.Use ajax - deixe uma chamada de servidor para obter a página HTML correspondente e defina -a como INnerHTML do controle HTML.
2. Use tecnologias de servidor do servidor, como JSP, PHP para incluir páginas HTML em páginas dinâmicas.
Usando o AngularJS, podemos usar a diretiva NG-Include para incorporar outra página HTML em uma página HTML.
<div ng-App = "" ng-controller = "StudentController"> <div ng-include = "'main.html'"> </div> <div ng-include = "'súdito.html'"> </div>
exemplo
TryangularJs.html
<html> <head> <title> angular js inclui </title> <yoy> tabela, th, td {borda: 1px cinza sólido; colapso da fronteira: colapso; preenchimento: 5px;} tabela tr: nth-child (ímpar) {background-color: #f2f2f2;} tabela tr: nth-child (par) {background-color: #ffffff;} </styled> </head> <body> <h2> aplicação de amostra de angularjs <er " ng-include = "'main.html'"> </div> <div ng-include = "'sujeitos {Nome: 'Física', Marks: 70}, {Nome: 'Chemistry', Marks: 80}, {Nome: 'Math', Marks: 65}, {Nome: 'English', Marks: 75}, {Nome: 'Hindi', Marks: 67}], FullName: FUNCIONAL () {VARObject; StudentObject = $ SCOPE.STUDENT; Retorne statãobject.firstname + "" + studpobject.lastName; }};} </script> <script src = "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"> </sCript> </body> </html>main.html
<table> <tr> <td> Digite o primeiro nome: </td> <td> <input type = "text" ng-model = "student.firstname"> </td> </tr> <tr> <td> digite o sobrenome: </td> <td> <typ type = "text" ng-model = ".Lastn: " </td> <td> {{student.fullname ()}} </td> </tr> </table>sujeitos.html
<p> Assuntos: </p> <table> <tr> <th> nome </th> <th> marcas </th> </tr> <tr ng-repeat = "Assunto em Student.subjects"> <td> {{sujeito.name}} </td <td> {{{sujeito.marks}}Saída
Para executar este exemplo, você precisa implantar textangularjs.html, main.html e sujeitos.html em um servidor da web. Open textangularjs.html em um navegador da web usando o URL do servidor. Veja os resultados.
O exposto acima são as informações incluídas no AngularJS. Continuaremos a organizar o conhecimento relevante no futuro. Obrigado pelo seu apoio a este site!