Ng-click does not trigger from div or p or span

In the following template. Click on header bar triggers ng-click and I get a break in ‘clicked()’ but from other tags it does not. What gives?

<div class="dashbox">
  <ion-header-bar ng-click="clicked('header')" class="bar bar-dark box-title">
        CWNH {{$id}} {{metadata.description}}

  <content ng-click="clicked('content')">
    <div class="box-contents" style="color:green" ng-show="showMe">
        <p ng-click="clicked('p')">{{tableId}}-{{iam}}</p>
        <div><span style="color:red">boxType=</span>{{boxType}}</div>
        <div ng-click="clicked('meta')"><span style="color:red">m=</span> {{tableM}}</div>

I also tried using data-ng-click because WebStorm gives warnings about ng-click not allowed, but had no visible difference.

I also tried replacing ‘content’ with ‘div’ but again no change in behavior.

Using node 0.10.36, ionic 1.3.19 (CLI), ionic v1.0.0-rc.1 on Windows 7. Just beginning to use ionic.


edit - testing using ionic serve on Chrome

You should use ion-content instead of content. Can you reproduce this in a codepen? I don’t see the issue in this codepen.

brandyshea, Thanks. I must have done something wrong today when reinstalling node to 0.10.36 (because of some sass issues and after some googling). Before seeing your reply I just cleaned up my directory, reinstalled node and ionic and copied back my www code and it now goes to click(). Thanks anyway.

1 Like

brandyshea, thanks also for the tip on ion-content. I was misled by the fact that with ion-content I was getting “position:absolute” which was messing up my page made of many boxes of content. Now I have switched to using card for my collection of content boxes and everything is so much easier.

1 Like