As I embark on my journey of creating my very first Angular app, I've encountered a couple of stumbling blocks that have left me scratching my head in confusion. The issue arises when I try to include the following snippet within my template:
<button ng-hide="results.length === projects.length" ng-click="limit = limit +3; gotoBottom()">Show More</button>
Strangely, whenever this button is placed inside the template, the app refuses to load. However, if I paste it outside of the template, everything functions perfectly fine. Ideally, I would like to keep this button within the template. Can someone please shed some light on what might be going wrong?
In addition to resolving the loading issue, I am also facing difficulties with getting the button to scroll to the #footer div using the ng-click function as shown below:
$scope.gotoBottom = function() {
$location.hash('footer');
$anchorScroll();
};
To provide more context and clarity, I have created a Plunker showcasing my code, which can be accessed through the following link: