Hi, I followed a tutorial to find out how to use the angularjs routes. I
did some, but nothing works:
My index:
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html ng-app>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular-route.min.js"></script>
</head>
<body ng-app="MonApp">
<div ng-view=""></div>
<p>
<a href="#/route1">route 1 </a><br />
</p>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a
name here">
<hr>
<h1>Hello {{yourName}}!</h1>
</div>
<script>
var app = angular.module('MonApp', ['ngRoute']);
app.config(function($routeProvider) {
$routeProvider
.when('/', {templateUrl: 'home.html'})
.when('/route1', {templateUrl: 'anime.html'})
.otherwise({redirectTo: '/'});
});
</script>
</body>
</html>
All my files (home.html and anime.html) are on the same directory and I'm
working in local:
*http://localhost:8383/SiteWeb/index.html#/*
But even when I arrive to my '/' page, nothing happens, I only have my
index's stuff, but not the "home.html" page stuff. same for my route,
doesn't work, only the url change:
*http://localhost:8383/SiteWeb/index.html#/route1*
but not the content. I could use a little help ^^' for any other
informations, ask me. Thanks !
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.