bing
Flat 10% & upto 50% off + Free additional Courses. Hurry up!
×
UPTO
50%
OFF!

AngularJS Includes

 

HTML cannot have the HTML pages into another HTML pages at present. But by using AngularJS you can include the HTML pages into another HTML pages.

Syntax

<div ng-include = "’details.htm'"></div>

Example

details.htm

<table border="1">

<tr>

<td>Id:</td>

<td><input type="number" ng-model="id"></td></tr>

<tr><td>Name: </td>

<td><input type="text" ng-model="name"></td></tr>

<br><tr>

<td>Details of Employee:</td>

<td>{{id + ", " + name}}</td>

</tr>

</table>

 

employeedetails.htm

<!DOCTYPE html>

<html>

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>

<body>

<div ng-app="details" ng-controller="employeeCtrl">

<div ng-include = "'details.htm'"></div>  // include details.htm file

</div>

<script>

var details= angular.module('details', []);

details.controller('employeeCtrl', function($scope) {

$scope.id = 20;

$scope.name = "abc";

});

</script>

</body>

</html>

 Output

o21

"0 Responses on AngularJS Includes"

100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.
top

Sales Offer

  • To avail this offer, enroll before 19th November 2017.
  • This offer cannot be combined with any other offer.
  • This offer is valid on selected courses only.
  • Please use coupon codes mentioned below to avail the offer

Sign Up or Login to view the Free AngularJS Includes.