Nav bar title ng-click problem

Hello!

I have a bit of a problem with my nav bar. Basically, in the code blow, I can’t get doSomething() to start. I have a feeling it’s related to the .disable-user-behavior class, however I tried overriding those styles to the defaults in .nav-bar and it still didn’t work. Is there something obvious that I’m not seeing?

<ion-nav-bar class="nav-bar" no-tap-scroll="true">

	<div class="buttons">
		<button class="button button-icon icon ion-person"></button>
	</div>

	<h1 class="title">
		<div class="logo" ng-click="doSomething()">
			<img src="img/logo.png" />
		</div>
	</h1>

	<div class="buttons">
		<button class="button button-icon icon ion-navicon" ng-click="toggleMenu()"></button>
	</div>

</ion-nav-bar>

I’ve also tried making both the h1 and the image tags have the ng-click instead and it still doesn’t do anything.

Many thanks!

So I found out what was wrong. The ion-nav-bar generates a h1 which covers over my own one. The h1 has a class of .ng-binding, so I just put this in my CSS:

.nav-bar h1.ng-binding {
	display: none;
}
1 Like