Side menu toggle not updating main page


#1

Folks,

I need to implement a side menu toggle “button” in my app. Basically all of the links in my side menu, except one, are normal links to new pages but one is a toggle that turns on an off something on a main page.

I’ve built a codepen example like I want to implement. Basically, that example should add a new item to the playlist. It does add it to the scope variables but the list is not re-renedered.

I really hope one of you can help.

Thanks in advance.


#2

Wow. That’s an interesting bug.

To prove it’s a problem, I’ve forked your sample and put a new button in the nav bar. Clicking it calls the same function as your toggle in the side menu. When called from the nav bar, the toggle method properly adds items to the list.

I also made used “dot notation” on the scope (even though the array is not a primitive) just to prove that’s not the problem. Finally, I also did a resize on the scroll to see if that helped. No luck.

I think you should open an issue unless someone else has a good idea?


#3

@Calendee: thanks so much for the quick reply. I’ll hang on in case anyone else has anything to add. After that I’ll log a bug. This is a pretty big issue for my app


#4

Issue logged. Hopefully someone can get to this soon


#5

Issue resolved:

The problem in your codepen is that you are using ‘AppCtrl’ as the controller on both routes.

This is actually making it so each route is creating its own instance of AppCtrl.