No data is being displayed on the empty result page
Below is the content of the Js File:
var Movies = angular.module('Movies', []);
Movies.controller('MoviesController',['$scope', '$http', function
($scope, $http) {
$http.get('http://localhost:19290/CinemaAngularJs/JS/data.json')
.success(function (data) {
$scope.Movies = data.Movs;
})
.error(function (data) {
alert("Error occurred");
});
}]);
The Data.json File contains:
"Movs":[
{
"name":"Mision Impossible",
"img":"mi",
"year":"2012",
"short":"Mission Impossible 2012 Mission Impossible 2012 Mission Impossible
2012 Mission Impossible 2012",
"description":"Mission Impossible 2012 Mission Impossible"
},
{
.............
}]
The HTML File includes:
<html xmlns="http://www.w3.org/1999/xhtml" ng-app="Movies">
<head runat="server">
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/2.0.0-beta.1/angular2.min.js"></script>
<script src="angular.min.js"></script>
<script src="JS/controller.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div ng-controller="MoviesController">
<ul class="large-block-grid-4 small-block-grid-2">
<li ng-repeat="mov in Movies">
<h2>Name : {{mov.name}}</h2>
<img ng-src="Img/{{mov.img}}.jpg" alt="Image Here" />
<h3>Year : {{mov.year}}</h3>
<h3>Short Description : {{mov.short}}</h3>
<h3>Description : {{mov.description}}</h3>
</li>
</ul>
</div>
</form>
</body>
</html>
Identify any errors in the code and suggest steps to troubleshoot and resolve them.