multiple functions in ng-click only fire on function once
<p>I created a function which combine two other functions (recorder.start() and recorder.stop()) which can fire separately. When I tried to add these functions in one ng-click, the program only could fire one function at one time. If the program would like fire the second functions, I had to press the button again.Is it possible to fire two functions after press the button once?</p>

<p>JavaScript</p>

<pre><code>$scope.record = function() {
        recorder.start($scope.recordConfig).then(function() {
            var test = $scope.recordConfig.captureSource;
        recorder.stop();
        })
    },

n.start = function(e) { 
        return t.postMessage("start", e)
    }, 

n.stop = function() {
        t.postMessage("stop")
    }, 

c.postMessage = function(e, t) { 
            return c.getPort().then(function(n) { 
                return n.postMessage({
                    type: e, 
                    data: t
                })
            })
        },
</code></pre>

<p>HTML</p>

<pre><code>&lt;md-button ng-click="record()" class="md-primary md-raised"&gt;Start Recording&lt;/md-button&gt;
</code></pre>

<p>=======================================================================</p>

<ul>
<li>Further question:
In this stage, I tried to use the below code in popup.html.js to control the two functions in one action. But I found the popup window will be closed when user change to another tab of chrome. As <a href="https://developer.chrome.com/extensions/faq#faq-dev-05" rel="nofollow">https://developer.chrome.com/extensions/faq#faq-dev-05</a> explained, "popups automatically close when the user focuses on some portion of the browser outside of the popup." Do you know any manner to keep the popup window always open? or let the stop() can run when the popup window is closed.</li>
</ul>

<p>popup.html.js</p>

<pre><code>    $scope.recordStart = function() {
       // recorder is an angular module which can postMessage such as start/stop/pause... ...

       recorder.start($scope.recordConfig)
        .then(function() {
            var test =  $scope.recordConfig.captureSource;
            "tab" !== test &amp;&amp; "desktop" !== test || a.IS_E2E;
        })     


$scope.stop = function() {
        recorder.stop();
    }, 

$scope.record = function() {
      $scope.recordStart();
        $timeout(function(){$scope.stop(); },4000)
 }
</code></pre>