Unable to scroll up to the top of a menu from a button click - AngularJS
<p><strong>Question Background:</strong></p>

<p>I am using Jasny Bootstrap's Reveal Menu. A demo can be found here:</p>

<p><a href="http://codepen.io/michaelbowlin/pen/lDqpm" rel="nofollow noreferrer">http://codepen.io/michaelbowlin/pen/lDqpm</a></p>

<p><strong>The Issue:</strong></p>

<p>Within my reveal menu I have a form that requires the revealed panel to be scrolled up to the top when the button is either opened or closed from a click. The following shows the menu panel revealed with the scroll bar active:</p>

<p><a href="https://i.stack.imgur.com/KpT8L.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KpT8L.jpg" alt="enter image description here"></a></p>

<p>The following is the menu markup for the menu:</p>

<pre><code>&lt;div class="navmenu navmenu-default navmenu-fixed-left" id="updateMenu"&gt;
    //*********Form**********
&lt;/div&gt;
&lt;div class="navbar navbar-default navbar-fixed-top"&gt;
    &lt;button id="menuBtn" type="button" ng-click="ScrollUp()" class="navbar-toggle" data-toggle="offcanvas" data-recalc="false" data-target=".navmenu" data-canvas=".canvas"&gt;
        &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;span class="icon-bar"&gt;&lt;/span&gt;
    &lt;/button&gt;
&lt;/div&gt;
</code></pre>

<p>I have added a <code>ng-click</code> directive on the <code>Button</code> markup and give this the ID of <code>updateMenu</code>. This calls a function named ScrollUp() on the $scope object on the UpdateController, as shown:</p>

<pre><code>app.controller('UpdateController', function ($scope, $timeout, $location,   $anchorScroll, $window, searchService) {
            $scope.ScrollUp = function () {

            $location.hash('#updateMenu');

            $anchorScroll();
        }
    }
</code></pre>

<p>Currently this does not work. I have also tried the following functionality which does not work:</p>

<pre><code>    app.controller('UpdateController', function ($scope, $timeout, $location,   $anchorScroll, $window, searchService) {

               $scope.ScrollUp = function () {

              $window.scrollTo(0, angular.element('#updateMenu').offsetTop);
    }

}
</code></pre>

<p><strong>How can I scroll up to the top of the revealed menu when the user clicks the button <code>updateMenu</code>?</strong></p>