$state and $stateProvider unusual behaviour while using an infinitescroll and a for loop

I am having some trouble understanding the difference between all those $state, $stateProvider and $routeProvider.

The problem is that I am trying to implement an infinite-scroll in a simple app with posts. Since I managed to do that, the nested urls for more info about the post are not working. Here is a link from plnkr.co (http://embed.plnkr.co/66hgiIxNGTXOuVZgqKvZ/preview)

When on the feed tab everything seems fine, but when a link is clicked, empty page is displayed.

Let me try to make it simple.

$stateProvider

To maintain application's state and provide a basic block to configure URL to represent view accordingly.

Each part of the state represents.

  • url : The URL route that can be accessed via href properties
  • templateUrl: The path to the view template HTML file
  • controller : The controller to be used in this view

$urlRouterProvider

Simply use for routing the user to specified url. where .otherwise method do route to the default url when the path doesn't match any of the urls you configured.

in your example you should handle the parameter in your controller to render the detail page.

I recommend you to follow this example to understand how navigation and routing can simply implement in your application.