The state routing is not working well for me. The first link called home loads automatically if I click the link in home page it should go to search page but instead it appends the data to the home page itself. so I see both home and search page data in same page.
index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="js/index.js"></script>
<!--<base href="/">-->
</head>
<body ng-app="hello">
<ion-nav-view></ion-nav-view>
</body>
</html>
index.js
angular.module('hello', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('home');
$stateProvider.state('home', {
url: "/home",
templateUrl: "/home.html"
});
$stateProvider.state('search', {
url: "/search",
templateUrl: "/search.html"
});
});
home.html
<a href="#/search">Go to Search</a>
search.html
<div> you are in Search Screen</div>
I have created a Plunker , but for some reason I don't see any output http://plnkr.co/edit/UpnS01Oy2MLqHvKSAPST
ui-sref="search"- BotanMan