is there any way to add new dynamic pages on Ionic Framework?
Can I edit in some way $stateProvider
adding new pages from a controller?
$stateProvider
.state('loading', {
name: 'newpage' + dyn,
url: '/newpage' + dyn,
templateUrl: 'thisisfixed.html',
controller: 'PageCtrl',
})
Thanks, Claudio
It is possible, but ... It could behave a bit differently then you expect. Because the url will be defined after configuration phase, it won't be working on Refresh (F5) or when such URL is passed to other user. Simply, what is not ready in config phase - is not available directly.
But - if that should work only inside of the application, you can do it like this:
var $stateProviderRef;
angular
.module(...)
.config(['$stateProvider', function($stateProvider){
$stateProviderRef = $stateProvider;
}])
And you can later assing more states... using $stateProviderRef