当我在 body 标签上使用ng-app='myApp'指令时,它会抛出' element[0].setTabbarVisibility is not a function ' 错误。
如果我不包括 ng-app,它工作正常。
为什么会这样?
var module=ons.bootstrap('myApp',['onsen']);
module.controller('MainController',function($scope){
console.log("Main controller");
});
<body ng-app="FirstProject" ng-controller="MainController">
<ons-tabbar>
<ons-tab label="tab1" page="tab1.html" active>
</ons-tab>
<ons-tab label="tab2" page="tab2.html">
</ons-tab>
</ons-tabbar>
<ons-template id="tab1.html">
<ons-page>
<p style="text-align: center;">
This is the first page.
</p>
</ons-page>
</ons-template>
<ons-template id="tab2.html">
<ons-page>
<p style="text-align: center;">
This is the second page.
</p>
</ons-page>
</ons-template>
</body>