I am trying to create a multi step form in my web app for registration.
I am using ui.router to achieve that.
When a user goes to my domain at first for example www.mydomain.com. My node.js server renders the index.ejs page.
app.get('/',function(req, res) {
res.render('index.ejs'); // load the index.ejs file
});
Now the important thing to know is that index.ejs is also where I am injecting my views in ui-view:
<!doctype html>
<html ng-app="myApp">
<head>
<title>Node Authentication</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.8/angular-ui-router.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.5/angular-animate.min.js"></script>
<link href="./css/side-menu.css" rel="stylesheet" type="text/css">
<script src="./js/mainApp.js"></script>
<script src="./js/controllers/knowledgeBaseCtrl.js"></script>
<script src="./js/services/knowledgeBaseFilter.js"></script>
</head>
<body ng-controller="projectsFilterCtrl">
<div class="container">
<div>
<h2>Our multistep form</h2>
<div id="status-buttons" class="text-center">
<a ui-sref-active="active" ui-sref="signup.stepOne"><span>1</span> Step One</a>
<a ui-sref-active="active" ui-sref="signup.stepTwo"><span>1</span> Step Two</a>
<a ui-sref-active="active" ui-sref="login"><span>2</span> login </a>
</div>
</div>
// INJECT VIEW HERE
<div ui-view></div>
</div>
</script>
</body>
</html>
My AngularJs controller:
var knowledgeBaseCtrl = angular.module('knowledgeBaseCtrl', ['ngAnimate','ui.router'])
knowledgeBaseCtrl.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('login', {// this will be the wrapper for our wizard
url: '/login',
templateUrl: './login.ejs',
})
.state('signup', {// this will be the wrapper for our wizard
url: '/signup',
templateUrl: './index.ejs',
})
.state('signup.stepOne', {// this will be the wrapper for our wizard
url: '/stepOne',
templateUrl: './stepOne.ejs',
})
.state('signup.stepTwo', {// this will be the wrapper for our wizard
url: '/stepTwo',
templateUrl: './stepTwo.ejs',
});
// catch all route
// send users to the form page
$urlRouterProvider.otherwise('login');
});
Now the issue:
Now when I go to the www.mydomain.com/#/signup/stepOne it loads the content twice as you can see in the image below.
I think its because my node.js server loads index.ejs and then my ui.router again loads index.ejs hence duplicating the page.
The image below shouldn't show the menu and the title twice

How can I get around this?