ionicNavBarDelegate right usage


#1

Hi,

I’m discovering the interestng world of mobile web through ionic since now a few days, and I wanted to thank you for the work you’ve done making it more easy to build quickly native/web app.

As I’m a beginner with ionic my question may look easy but I don’t understand how to properly use $ionicNavBarDelegate. In my controller, I’ve added it as argument:

tata.controller('MainCtrl', function($scope, $ionicNavBarDelegate, $ionicModal, $ionicSideMenuDelegate, SettingsService) { ...

$scope.activatedOnClik = function() {
   $ionicNavBarDelegate.setTitle('test');
 }
}

However I get the following error when running the app as if I didn’t spell the name correctly: https://docs.angularjs.org/error/$injector/unpr?p0=$ionicNavBarDelegateProvider%20<-%20$ionicNavBarDelegate from ionic.bundle.min.js:28

I don’t really know where does this come, if anyone has a clue please!

Thanks!


#2

did you add ‘ionic’ as a dependency to your tata module?


#3

Hi,

I think so, in js/app.js:

var tata = angular.module(‘tata’, [‘ionic’,‘ngResource’,‘wu.masonry’]);


#4

What version of ionic are you using?


#5

1.014 (Ubuntu 64bit), tested using firefox 25


#6

I think he meant what version of the framework and not the npm module. Open up your ionic.bundle.min.js and it will tell your the version.

Also, try using the non-min version “ionic.bundle.js” which might give you a more helpful error line number.