AngularJS - Dynamically adding views along with their routes and controllers

I am building an application where I'll be getting JSON file containing content. From that JSON, I will create a view(html), bind it to a controller and route that are to be created when I receive the JSON. It will be a list of items where each item leads to a different view, controller and route.

I need help in implementing this dynamic behavior in the application.

Much appreciated!

EDIT:

I forgot to mention that this is to be implemented in an Ionic Application

Just a quick thought...

  • Remove the ng-app attribute. This will prevent angular to bootstrap automatically.
  • Call for the JSON using XMLHttpRequest
  • use the retrieved data in the application config to build your routes
  • manually start the angular application calling angular.bootstrap More