I have noticed that every time I navigate to a different state, my templates and controllers are refreshing. This is not the behavior I want; I would like to retain the values entered into a form on contact.html when switching to home.html. Currently, I am working with Angular v1.6 & UI-Router v1+. Here is how my setup looks:
function() {
"use strict";
angular.module("App").config(["$stateProvider", "$urlRouterProvider", "$locationProvider", "$compileProvider", function(a, b, c, d) {
c.html5Mode(false), c.hashPrefix(""), b.otherwise("/"), a.state("home", {
url: "/",
templateUrl: "views/home.html",
controller: "HomeCtrl"
}).state("projekte", {
url: "/projekte",
templateUrl: "views/projects.html",
controller: "ProjectsCtrl"
}).state("labor", {
url: "/labor",
templateUrl: "views/lab.html",
controller: "LabCtrl"
}).state("kontakt", {
url: "/kontakt",
templateUrl: "views/contact.html",
controller: "ContactCtrl"
})
d.debugInfoEnabled(false);
}])
}.call(this),
This is the structure of my index.html:
<body ng-app="App">
<main ui-view="">
..contact.html ..projects.html
</main>
</body>
The question I have is:
How can I switch between states without causing a refresh in my templates/controllers?