johnpapa / ng-demos

variety of angular demos
MIT License
1.7k stars 961 forks source link

Ever growing route array in routehelper.js #94

Open OneHoopyFrood opened 8 years ago

OneHoopyFrood commented 8 years ago

I'm not totally sure what's supposed to be going on here. It's totally possible I'm just missing something here.

Here's what I'm seeing. In routehelper.js the getRoutes() function is pushing what appears to be the same data onto the routes array property with every call.

This is leading to the array growing linearly with every call. This begins to bog performance if you're having to iterate though the results. (We're using this routing structure in our app and iterate though it as part of building the navigation)

Is this intended functionality or a bug? If it's supposed to do this, why?