I'm trying to include an html page
(like header), but I can't get the include to work.
I want to create a page like header and footer
, and want these pages to include on every html page in application just like we do in PHP
. We create a page and include it using include or require
.
Like if i have these lines of code
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Angular Demo</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css.map">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<script src="js/jquery-2.1.4.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/custom.js"></script>
</head>
Now i want to include these line on every HTML page.I don't want to write these lines on every page.
Is it possible to do this in Angular js using ng-include
or something else.
I have tried this
<div ng-include src="'include/header.html'"></div>
If i use ng-include
it only include some piece of code in div
. But how can i use it like header and footer to include on every page.
only include some piece of code in div
mean? Usingng-include
should work fine. SHould update your<doctype>
BTW