dimanche 13 avril 2014

Can Angular.js be used in "classic asp" websites?


Vote count:

0




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://ift.tt/191vdKI"></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?



asked 3 mins ago






Aucun commentaire:

Enregistrer un commentaire