I am developing a mobile application using Ionic framework. I get a JSON
file containing the template and it's controller. The server will push data once there's data in JSON
format. The problem is adding the states dynamically, and I have read that it's only possible at the config time.
Please tell me if there's a way to do this through a controller which will only be responsible of receiving and setting the new state and that will also receive the JSON
and from it create the new state.
The help is highly appreciated!
Edit
I have found ui-router-extras (http://christopherthielen.github.io/ui-router-extras/#/future), but I don't know how to make it work for my application.
Suppose a controller gets the JSON using $http where the JSON
looks like:
{
'name':'preview',
'template':'<h1>Hello</h2>'
}
How to add this state in this controller?