I've encountered some challenges while trying to run angular on my computer. I have been studying angular through demos on w3 schools that showcase various components.
Currently, I am experimenting with this one:
http://www.w3schools.com/angular/tryit.asp?filename=try_ng_routing_template
This is the code snippet I am utilizing:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-route.js"></script>
<body ng-app="myApp">
<p><a href="#/">Main</a></p>
<a href="#banana">Banana</a>
<a href="#tomato">Tomato</a>
<p>Click on the links to change the content.</p>
<p>The HTML displayed in the ng-view directive are defined in the template property of the $routeProvider.when method.</p>
<div ng-view></div>
<script>
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
template : "<h1>Main</h1><p>Click on the links to modify this content</p>"
})
.when("/banana", {
template : "<h1>Banana</h1><p>Bananas consist of about 75% water.</p>"
})
.when("/tomato", {
template : "<h1>Tomato</h1><p>Tomatoes contain approximately 95% water.</p>"
});
});
</script>
</body>
</html>
The header tags aren't switching properly on my system.
Edit: The code works fine on other systems but not on mine. It's located in my apache folder and running on localhost. JavaScript, php, and html work smoothly. I've also used jQuery without any issues. Any insights into why angular might be facing problems?