I've have two file that are basically the same. A classic .asp file, and the viewsource of the .asp saved as a HTML file. In both I include the jquery framework, the angular.js framework, and project specific js. The html and asp both contain
<html ng-app="WillisPrecastProjects">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/precast.js"></script>
<div ng-controller="MainController">
<div ng-repeat="data in projectData">
<h3>{{data.name}}</h3>
<p>{{data.address}}</p>
</div>
</div>
precast.js:
var app = angular.module('WillisPrecastProjects', []);
// Load JSON
app.controller('MainController', function($scope, $http){
$http.get('js/generic.json').success(function(project_data){
$scope.projectData = project_data;
});
})
generic.json:
[
{
"longitude": 19.069341,
"latitude": -155.566242,
"heading": 120,
"name":"Hawaii",
"address":"Naalehu, HI (USA)",
"pitch": 10,
"fov": 90
},
{
"longitude": 51.876072,
"latitude": 0.55454,
"heading": 90,
"name": "Braintree",
"address": "Station Approach, BRAINTREE CM7 3QL (UK)",
"pitch": 10,
"fov": 90
},
{
"longitude": 51.794423,
"latitude": 0.632222,
"heading": 262.62,
"name": "Witham, Chipping Hill",
"address": "Windsor Close, Hatfield Road, WITHAM, CM8 1GH (UK)",
"pitch": 10,
"fov": 90
}
]
The Angular works in the html, but does not work in classic asp. Is there a reason why this happens?
Note: I'm viewing the html files through apache localhost via XAMPP. I'm viewing the classic asp in debug mode via IIS in Visual Studio 2013.
1 @Anthony - precisely. No errors are thrown. Angular simply does not work in the VS build of the classic ASP site.
2 @John - The JS pathing is fine. Clicking on the link to each JS file in each view source loads all of the JS files load.
3 @Brian, 4 @John - I'm thinking it might be the way Visual Studio builds. I'm not actually using IIS natively. I'm using Visual Studio's builtin dev server. But what I find interesting is it DOES support classic asp in that I can build the classic asp project/solution that page works. It's just the Angular stuff doesn't work. Perhaps VS's builtin dev server is doing something to the angular tag attributes. But if this was the case how would people CS and ASP.NET programmers build Angular apps in Visual Studio 2013?
I appreciate all your advice and suggestions. My apologies that I cannot supply the actual source code in its entirety. Any other suggestions is greatly appreciated.