Here is my index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0 ,user-scalable=no">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular-route.js"></script>
<script src="app.js"></script>
<title>TESTS</title>
</head>
<body ng-app="testApp">
<a href="#link">Testing angularjs routing</a>
<div ng-view>{{message}}</div>
<div ng-controller="TestController">{{message}}</div>
</body>
</html>
And here is app.js:
var testApp = angular.module('testApp', ['ngRoute'])
.config(function($routeProvider) {
$routeProvider
.when('/', {
templateUrl:'index.html',
controller: 'TestController'
}).when('/link', {
templateUrl:'link.html',
controller:'LinkController'
});
});
testApp.controller('TestController', function ($scope) {
$scope.message = "INDEX";
});
testApp.controller('LinkController', function ($scope) {
$scope.message = "LINK";
});
I'm trying to make routing work, but my link not clickabble at all, despite the fact that it looks like a normal link. Second message showing "INDEX", so I think problem in ng-view, because if I delete line with ng-view link become clickable again! I don't have a clue whats wrong!