在温泉 ui 和 angularjs 中使用 ons.enableAutoStatusBarFill

Use ons.enableAutoStatusBarFill in in onsen ui with angularjs

我是 Angularjs 的新手,我想了解如何使用 ons.enableAutoStatusBarFill(); 这个,所以我的菜单不会接管状态栏。

这是我设置控制器的方式。

var mod = ons.bootstrap('app', ['onsen']);

mod.controller('MyControler', function($scope) {

ons.ready(function() {

            // code inside...

    });           
});

任何建议都会有所帮助。我正在使用这个参考 http://onsen.io/guide/overview.html#UtilityAPIs

我试过这样解决的

var module = ons.bootstrap('my-app', ['onsen', 'ngSanitize']);
var module = ons.enableAutoStatusBarFill();

它似乎可以正常工作,但现在找不到我的控制器。收到此错误

Uncaught TypeError: Cannot read property 'controller' of undefined

我解决了。实际上 cordoda 文件在我页面的底部。因此页面无法正确加载。

现在我在 index.html 中添加了这个模式并解决了它。

 <script src="lib/onsen/js/angular/angular.js"></script>    
  <script src="lib/onsen/js/onsenui.js"></script>    
  <script src="lib/onsen/js/angular/angular-sanitize.min.js"></script>
  <script src="cordova.js"></script> //This should be added first before the main custom.js file which starts my module.

  <script src="js/custom.js"></script>

感谢大家的支持!