I just started with MEAN stack and i'm following some TUTs.
I'm using the npm-views
from Angular and trying to redirect an html a
tag to another html file. However when I go to localhost:3000
I get this: localhost:3000/#!/
and the when I the link inside that page it simply adds localhost:3000/#!/#%2Fsl
.
My index.html is this (without some elements -- too much text // I removed all the js and css files but I have them all in my file):
<!DOCTYPE html>
<html ng-app="firstApp">
<head>
<script type="text/javascript">
var app = angular.module('firstApp',['ngRoute']);
app.config(function($routeProvider){
$routeProvider
.when('/', {
templateUrl: 'home.html',
controller: 'HomeController',
})
.when('/sl', {
templateUrl: 'sl.html',
controller: 'SLController',
});
});
app.controller('HomeController', function ($scope, $http){
console.log('Home page');
});
app.controller('SLController', function ($scope, $http){
console.log('Signup page');
});
</script>
<title>First Node.JS app</title>
</head>
<body>
<div class="container-fluid">
<h1 id="indexTitle"> MyFirst App </h1>
<div ng-view></div>
</div>
</body>
</html>
My home.html file is this:
<div class="container main-forms" id="main-forms">
<h3 id="letMeIn1"><a href="#/sl" id="letMeIn">Let me in</a></h3>
</div>
and my sl.html file is this:
<div class="container main-forms" id="main-forms">
<div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active tab-btn"><a href="#login" class="tab-link" id="login1" aria-controls="login" role="tab" data-toggle="tab">Login</a></li>
<li role="presentation" class="tab-btn"><a href="#signup" class="tab-link" id="signup1" aria-controls="signup" role="tab" data-toggle="tab">Sign Up</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="login">
<div class=" row main col-md-6 col-md-offset-3">
<form class="form-group">
<h3 class="form-titles center-block">Login</h3>
<input type="text" class="form-control form-subtitles" placeholder="Usuario">
<input type="password" class="form-control form-subtitles" placeholder="Password">
<input type="submit" class="form-control form-subtitles btn btn-info" value="Login">
</form>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="signup">
<div class=" row main col-md-6 col-md-offset-3">
<form class="form-group">
<h3 class="form-titles center-block">Sign Up</h3>
<input type="text" class="form-control form-subtitles" placeholder="Usuario">
<input type="text" class="form-control form-subtitles" placeholder="E-mail">
<input type="password" class="form-control form-subtitles" placeholder="Password">
<input type="submit" class="form-control form-subtitles btn btn-info" value="Signup">
</form>
</div>
</div>
</div>
</div>
</div>