-2
有沒有什麼辦法可以使用ons-navigator切換頁面,而不需要ons-template標籤? 例如,我有這樣的項目:帶有onsen導航器和AngularJS的切換頁面
--app.js
--index.html
--page1.html
當我描述page1.html到的index.html,使用插件模板(這樣http://codepen.io/onsen/pen/yrhtv)一切都很OK。但如果我試圖設置路徑到
myNavigator.pushPage('page1.html', { animation : 'slide' })
沒有使用ons模板我的應用程序不起作用。
您是使用網絡服務器來提供應用程序還是隻使用瀏覽器打開文件? 您需要使用Web服務器,因爲Onsen會請求'page1.html'。 –