I have an Angular application with different types of pages, all identified by a slug right after the base url, so like:
http://example.com/slug-a
http://example.com/slug-b
Slug a and b are of different types and need to be rendered in a different view. The data belonging to the objects identified by slug a and b is fetched from the server, and the Angular application is supposed to change the view based on the object type.
Is it possible to handle this in the ngRoute's $routeProvider? I can't find any documentation that helps me with this, and I'm sure I'm not the first one to try this..
So, in short:
- Client requests slug A => Angular requests data from Server => Angular loads ControllerA with template A.
- Client requests slug B => Angular requests data from Server => Angular loads ControllerB with template B
Different view based on server response.