# Cannot use a link to change views properly

**URL:** <https://forum.ionicframework.com/t/cannot-use-a-link-to-change-views-properly/73392>\
**Category:** ionic-v1\
**Created:** [December 15, 2016, 4:09pm UTC](https://forum.ionicframework.com/t/cannot-use-a-link-to-change-views-properly/73392 "2016-12-15T16:09:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommyd456](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@tommyd456](https://forum.ionicframework.com/u/tommyd456)\
**Post date:** [December 15, 2016, 4:09pm UTC](https://forum.ionicframework.com/t/cannot-use-a-link-to-change-views-properly/73392/1 "2016-12-15T16:09:22Z")

</div>

Trying out Ionic 1 for the first time but I can’t get a simple link to change states properly.

I have two states: **welcome** and **login**

```
<ion-view>
  <ion-content>
    <h1>Welcome</h1>
    <a ui-sref="login">Login</a>
  </ion-content>
</ion-view>

<ion-view>
  <ion-content>
    <h1>Login</h1>
  </ion-content>
</ion-view>

```

My states:

```
.state('welcome', {
  url: '/welcome',
  templateUrl: 'templates/welcome.html',
  controller: 'AppCtrl'
})

.state('login', {
  url: '/login',
  templateUrl: 'templates/login.html',
  controller: 'LoginCtrl'
})

```

When I view my app in the browser I see the Welcome page normally but when I click on the link to go to the Login page, the h1 Login header just appears underneath the text already on the welcome page. The URL does update to /login and if I refresh then just the login h1 shows.

What am I doing wrong?
