Ionic $cordovaStatusbar


#1

I have already the status bar plugin: cordova plugin add org.apache.cordova.statusbar
However, when I inject it:

.run(function($ionicPlatform, $cordovaStatusbar)

It says: Uncaught Error: [$injector:unpr] Unknown provider: $cordovaStatusbarProvider <- $cordovaStatusbar

What is it?


#2

Do you also have ngCordova http://ngcordova.com/docs/install/?
Because $cordovaStatusbar is the syntax for this plugin only if you use ngCordova http://ngcordova.com/docs/plugins/statusbar/


#3

You are right.

I solved it by installing ‘ngCordova’:

bower install ngCordova --save


#4

It’s supposed to work with Ionic.Native as well, this is an error


#5

I have the same error, I am trying to migrate from ngCordova to Ionic.Native…so I removed ngCordova from my app.

Can you help please ?


#6

Ok in case it can help others:
ngCordova uses : $cordovaStatusbar

while ionic.Native uses $cordovaStatusBar with a capital B.

grrrr!!

And in case you were using $cordovaStatusbar.style(1) with ngCordova, this function doesn’t exist anymore, you need to use : $cordovaStatusBar.styleLightContent() instead.