2
I have a controller called Productocontroller in Angularjs, this controller should have two methods, one to list all products when I pass a URL and another method to bring the product details when it is another URL.
Example:
/produto/:codDepartamento - Rota para listar os departamentos
/produto/ficha/:codProduto - Rota para exibir os detalhes do produto
How would it be done to call a method from these routes?
I would advise using two controllers. But if you want to use one, take a look at the documentation on
$location
.– Beterraba