I am using Rails with Angularjs . So, i have link called "Notes" and when i click "Note" it takes me to url "http://localhost:3000/#/notes" and renders some templates through angularjs. When i reload the page , the templates didn't reload and when i click the link "Note" again then only it renders those templates.
So my simple question is On reloading the page , why all the contents that is rendered through angularjs disappears and how to fix this.
Updated
-javascript
-index.html
-routes.js
-view
-course
-index.html
view/course/index.html
<div class="row">
<div ng-include="'index.html'"></div>
</div>
javascript/index.html
<div class="nav-list">
<a ui-sref="notes"> Notes </a>
<a ui-sref="users"> Users </a>
</div>
<div class="main-wrapper">
<ui-view></ui-view>
</div>
javescript/routes.js
....
.state('notes', {
url: '/notes',
templateUrl: 'template/pages/notes/index.html',
controller: 'NotesIndexController'
})
.state('users', {
url: '/users',
templateUrl: 'template/pages/users/index.html'
})
...
I changed the above scenario to this
view/course/index.html
<div class="row">
<div class="nav-list">
<a ui-sref="notes"> Notes </a>
<a ui-sref="users"> Users </a>
</div>
<div class="hero-wrapper">
<div class="hero-content">
<div class="hero"></div>
</div>
</div>
<div class="main-wrapper">
<ui-view></ui-view>
</div>
</div>
This fixed my problem but what is the difference between above two scenarios . Why it is behaving differently . Thanks