So this is kind of tricky. When I go to this route
$routeProvider.when('/:slide_id',
{
templateUrl: 'views/create.html',
controller: 'CreateCtrl'
})
.otherwise({
redirectTo: '/'
});
My create.html view loads and my CreateCtrl glues to it right. The thing is that create.html is basically empty and in CreateCtrl what I'm doing is inserting directives like so
var chart = angular.element(document.createElement(type));
angular.element(document.getElementById("dropContainer")).append(chart);
$compile( chart )( $scope );
I'm doing this becasue the user can dynamically create charts with this tool. So when the view loads there are no charts and as the user interacts with the app charts get inserted. The problem is that if I go to the url /2 or /3 it again will load the create.html view and the CreateCtrl. If the user created some charts in /1 path those do not display obviously because it loads the create.html view which is empty.
The question is how can I push to the history of /1 the charts that the user is creating so that when the user goes back to /1 the charts load?
Hopefully I explained mhy self enough, if not please comment and let me know.
Thanks!
OK so answering my own comment here I basically gave up and changed the strategy. Instead of trying to rely on the history for dinamically inserted elements into the view I'm holding them in a separate object and recreating them else where when needed. If anyone ever finds a solution to this please comment.