AngularJS - why do I need to click twice on the button?

1 . I bought this template http://www.tattek.sk/minotaur-dash2/#/app/dashboard
and I'm customizing it.

2. You see the guy's photo on top right. You click on it once and the popup shows up
popup
3. In my site, I have to click on the "profile" twice.

You can see it here. Login and click on the name on top right (I don't have a photo)

Site: http://147.75.0.117:88

Login with admin@admin.com / Password321$

4. Unlike the theme code, I have a ng-click. It's expandUserInfo() . I see the "aria-expanded" is false when the page loads

element
5. I click on the "profle" name and I see the element updated but it's updated to "false" (it should be true). I click again and that's when it's updated to "true" and I see the popup.

What am I missing? how can I fix this? (I spent too much time on this trying to figure it out)
LVL 8
CamilliaAsked:
Who is Participating?
 
Julian HansenConnect With a Mentor Commented:
I just looked at the original template - they don't seem to have an ng-click on their profile area - is there any particular reason you added one to yours.
0
 
Julian HansenCommented:
Weird one - the first click is simply not registered. However, if you put a break point on the click handler it is.

I am wondering if there isn't another click handler somewhere "stealing" the first click.

In your controller in the expandUserInfo() function can you add a
console.log('clicked');

Open in new window

So we can see if the click is actually firing.
0
 
CamilliaAuthor Commented:
If there's no ng-click, how is the popup opened in the template?

I'll add the console.log and see. I'll post back tonight.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Julian HansenCommented:
I am guessing through a directive on an attribute - I have not had time to look at it in depth.
0
 
CamilliaAuthor Commented:
There's a directive folder. I'll look into it tonight and see if I can figure it out.
0
 
Julian HansenCommented:
If you don't come right post back - hopefully things will have eased up by then and I can investigate this more thoroughly.

It is an odd one though - if you try to debug the page and put a break point on your click handler it works.
0
 
CamilliaAuthor Commented:
Thanks, Julian. I'll look at the orig code and see how it works and go from there.
0
 
CamilliaAuthor Commented:
I added console.log('clicked'); and the ng-click gets called. I'll look at the template code and see how they're doing it without having ng-click.
0
 
CamilliaAuthor Commented:
Fixed!

I copied the entire tag from the template and copied it to my code and that worked.

You asked why I have ng-click. When I got the template, I wasn't as familiar with AngualrJS and started added ng-click to mimic what the template's functionality. I didn't think of just copying the code and see if that works. It did.
0
 
Julian HansenCommented:
Awesome, glad you are working.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.