我正在使用带角度的onsen ui,我想在角度运行中设置我的第一个导航页面:
if(....) navigator.pushPage('page1.html) 要么 navigator.pushPage('page2.html)
但即使使用ons.ready,我也找不到导航器变量。
我的HTML:
<ons-navigator var="appNavigator"></ons-navigator>
<script>
document.addEventListener("deviceready", function () {
// start Angular and onsen once device is ready (to avoid cordova plugin issues)
angular.bootstrap(document, ["wesapp", "onsen", 'templates']);
}, false);
</script>
我的angular.run:
var firstPageUrl;
if ($rootScope.settings.monNom && $rootScope.settings.monPrenom && $rootScope.settings.monEmail) {
firstPageUrl = 'app/views/home.page.html';
} else {
firstPageUrl = 'app/views/home-info.html';
}
ons.ready(function() {
appNavigator.pushPage(firstPageUrl, {animation: none});
});
当我启动我的应用程序时,我收到此错误:
none is not defined
答案 0 :(得分:0)
将animation
键值设置为'none'
字符串。
appNavigator.pushPage(firstPageUrl, {animation: 'none'});