My app can unlimited push the same view based on the content. My $stateProvider looks like this:
$stateProvider .state('categorie', { url: '/categorie/:slug', templateUrl: 'templates/categorie.html', controller: 'CategorieController', params: { data: null} })
The data in the view is displayed based on the ‘data’ and ‘slug’ variable. When i push a ‘categorie’ view when i am in a ‘categorie’ view it replaces the content of the current view and not the new view. Really weird behaviour. I have made a short demo to explain what i mean: https://www.dropbox.com/s/q48cpts8re4ty93/asdas.mov?dl=0
When i click the button “hier” you see a quick flash replacing the content of the current view and not the new view.
The code on the controller looks like this:
$scope.slugClick = function(slug) {
$localForage.getItem('data').then(function (data) {
var themes = JSON.parse(data).themes;
var tmp = $filter('filterTree')(themes, { slug: slug })[0];
$state.go("categorie", {slug: slug, data: tmp});
});
}
$scope.theme = $stateParams.data;
So when i click a link the “slugClick” will be fired and load the data and pass it to $state.go, but unfortunately as explained the data in the currentview is being replaces instead of being displayed in the new view.
Currently i’m clueless, anyone has a idea what goes wrong?