Initialise Revealjs using ui.router

190 Views Asked by At

In my app there are two kind of views:

  1. aViews having simple html code with no controller.

  2. bViews having js-code (RevealJs).

When I navigate from a bViews to a aViews, Revealjs apply his change also for the pages for which the controller is not specified (aViews). For example navigating from bViews to aViews I get the progressBar coming from the presentation!

Probably this behaviour comes from my angular implementation.

The code is the following:

 // router.js
 $stateProvider
    .state('index', aViews) // simple html
    .state('introduction', bViews) // having js code (Revela.initialize({}))

 // aViews
 return  {
        url: '/',
        views: {
            index: {
                template: indexTemplate
            }
        }
    };

 // bViews
 return  {
        url: '/',
        views: {
            slides: {
                template: presentationTemplate,
                controller: function ($scope) {
                    $scope.$on('$viewContentLoaded', function () {
                        Reveal.initialize({ ... });
                    })M
                }
            }
        }
    };

   // html code
<body>
    <div class="home" ui-view="index"></div>
    <div class="reveal">
        <div class="slides" ui-view="slides">
        </div>
    </div>
</body>
0

There are 0 best solutions below