-2

i am completely new to Angularjs trying to understand how can i use ons.enableAutoStatusBarFill(); this so i my menus wont over take the status bar.

here is how i have my controller setup.

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

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

ons.ready(function() {

            // code inside...

    });           
});

Any suggestions will be helpful. I am using this reference http://onsen.io/guide/overview.html#UtilityAPIs

I tried to solve it this way

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

It seems like working but its not finding my controllers now. Getting this error

Uncaught TypeError: Cannot read property 'controller' of undefined
user3201500
  • 1,538
  • 3
  • 22
  • 43
  • It's not clear what your problem is – thrau Apr 28 '15 at 00:20
  • 1
    I think `enableAutoStatusBarFill` is the default behaviour. In either case, it should be called in the beginning, not inside `ons.ready` nor AngularJS controller. Docs are here: http://onsen.io/guide/overview.html#disableautostatusbarfill – Fran Dios Apr 28 '15 at 01:02
  • I tried placing it everywhere but its not working... :( – user3201500 Apr 28 '15 at 04:52

1 Answers1

0

I got it solved. Actually the cordoda file was at the bottom of my page. Due to which the page was not able to load properly.

Now i added in this pattern in my index.html and got it resolved.

 <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>

Thank you for all your support!

user3201500
  • 1,538
  • 3
  • 22
  • 43