User-1026236167 posted
i have new in angular js my data not shown in <ng-view> in index page which thing is missing please execute them?
index page of angular js
<!DOCTYPE html>
<html data-ng-app="demo">
<head>
<meta charset="utf-8" />
<title></title>
<script src="Scripts/angular.min.js"></script>
<script src="Scripts/angular-route.min.js"></script>
<link href="StyleSheet1.css" rel="stylesheet" />
<script src="Scripts/script.js"></script>
<!--<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.9/angular.min.js"></script>-->
</head>
<body>
<table style="font-family: Arial">
<tr>
<td colspan="2" class="header">
<h1>
WebSite Header
</h1>
</td>
</tr>
<tr>
<td class="leftMenu">
<a href="#/home">Home</a>
</td>
<td class="mainContent">
<ng-view></ng-view>
</td>
</tr>
<tr>
<td colspan="2" class="footer">
<b>Website Footer</b>
</td>
</tr>
</table>
</body>
</html>
script page of angular js
var app = angular.module("demo", ["ngRoute"])
.config(function ($routeProvider) {
$routeProvider
.when("/home", {
templateUrl: "Templates/home.html",
controller:"homeController"
})
})
.controller("homeController", function ($scope) {
$scope.message = "Home page";
})
home page content of angular js
{{message}}
<div>
this is new
</div>
stylesheet of angular js
.header {
width: 800px;
height: 80px;
text-align: center;
background-color: #BDBDBD;
}
.footer {
background-color: #BDBDBD;
text-align: center;
}
.leftMenu {
height: 500px;
background-color: #D8D8D8;
width: 150px;
}
.mainContent {
height: 500px;
background-color: #E6E6E6;
width: 650px;
}
a {
display: block;
padding: 5px
}