Initialize Revealjs with ui.router

There are two kinds of views in my application:

  • aViews has simple html code without a controller.

  • bView with js-code (RevealJs).

When I navigate from bViews

to aViews

, Revealjs

apply its change also for pages for which no controller is specified (aViews). For example, going from bViews to aViews, I get a progressBar coming from the presentation!

This behavior probably comes from my angular implementation.

The code is as follows:

 // 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>

      

+3
angularjs angularjs-scope angular-ui-router reveal.js


source to share


No one has answered this question yet

Check out similar questions:

225
Ng model doesn't update controller value
22
Angular-ui.router: update url without refreshing view
3
Angular UI Router - Dynamic TemplateURL
1
Changing navigation state in AngularJS UL router
1
Why doesn't the controller inside the template destroy if it's listening on $ rootScope
1
Angular state pattern $ Ui.router ng-model is $ rootScope
1
ui.router: keep $ state state on exit and continuous on re-entry
1
ui-router changes url but doesn't load template angular-ui-router + ionic 1 +
0
Refreshing the page using angular routing (ui-sref) in spring boot + security + angular
0
Template loading error when moving between states ui-grorumb



All Articles
Loading...
X
Show
Funny
Dev
Pics