I am currently in the process of working on a project using the MEAN stack and I have encountered an issue with getting a specific template to display on a particular URL.
Currently, when users visit www.myurl/catalog, it loads the catalog.html template, similar to any other /catalog?category=productType URL.
My goal is to have the catalogSpecific.html template load when users visit /catalog?category=specificProductType. However, at the moment, the catalog.html template takes precedence over the catalogSpecific.html template. I have not been able to find much information on this specific problem, so any assistance would be highly appreciated.
Here is how my routes are set up:
app/front/app.js
angular.module('app', ['ngRoute',
'app.LandingModule.controller',
'app.CatalogModule.controller',
'app.ProductModule.controller',
'app.HeaderModule.directives',
'app.FooterModule.directives'
])
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'html/landing.html',
controller: 'LandingController'
})
.when('/catalog', {
templateUrl: 'html/catalog.html',
controller: 'CatalogController'
})
.when('/catalog?category=specificProductType', {
templateUrl: 'html/catalogSpecific.html',
controller: 'CatalogController'
})
.otherwise({
redirectTo: '/'
});
}]);