AngularJS app using ui-router. My list page loads correctly, but when clicking on links on the list page my url changes but my html on the page does not change, it remains on the list page. What is wrong with this routing?
app.js
var myApp = angular.module('myApp', ['ui.router']);
myApp.config([
'$stateProvider', function($stateProvider) {
$stateProvider
.state('products', {
url: '',
templateUrl: 'Scripts/templates/manageProducts/products.list.html',
controller: 'productListCtrl'
})
.state('products.detail', {
url: '/:id',
templateUrl: 'Scripts/templates/manageProducts/products.detail.html',
controller: 'productDetailCtrl'
});
}
]);
Index.html
<div ng-app="myApp">
<div ui-view></div>
</div>
On the products.list.html template:
<a ui-sref="products.detail({ id: 1 })">Detail for Item 1</a>
Should I even be using UI Router? The list and details page are 2 distinct screens.