There is a state in my code that links to a different page and a different controller. Here's how it looks:
.state('productEdit', {
url: '/productEdit/:id',
templateUrl: '/App/Main/views/products/editProduct.cshtml',
controller: 'app.views.products.editProduct',
controllerAs: 'vm'
})
The issue I'm facing is that when I navigate to this page or refresh the linked page, the controller doesn't initialize again. As a result, the variables get "stuck", even after clearing the cache.
I've implemented ui-sref in the following manner:
<div ng-repeat="product in vm.products" class="col-lg-4 col-md-4 col-sm-4 col-xs-4" >
<a ui-sref="productEdit({id: product.id})">
<div style="padding:5px">
<div class="card-product">
<h4>
{{product.name}}
</h4>
<p>
{{product.description}}
</p>
</div>
</div>
</a>
</div>
Does anyone have suggestions on how I can ensure that the controller reloads every time the page is reached?