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
source to share
No one has answered this question yet
Check out similar questions: