 <p>In your <code>for</code> loop, you created <code>var category</code> which is already a variable</p> <pre><code>$scope.browseCategories = function(category, moveTo) { //looping in order to create a new &lt;ul&gt; of children categories. var html = "&lt;ul class='unstyled'&gt;"; for (var I = 0; I &lt; category.Children.length; ++I) { var category = category.Children[I]; ^^^^^^^^ </code></pre> <p>Try renaming that and see.</p> <p>This might do whatever you are trying to achieve. Hope that helps.</p> <p>But when you're doing it in angular, the best practice is to avoid any other libraries like jQuery and try to achieve it in the angular way. Angular is so powerful.</p> <p>See this SO post: <a href="http://stackoverflow.com/questions/14994391/how-do-i-think-in-angularjs-if-i-have-a-jquery-background">How do I &quot;think in AngularJS&quot; if I have a jQuery background?</a></p>