self-executing anonymous functions and call it again
<p>I want to do something like this:</p>

<pre><code>var build= (function(){
  //my function body     
})();

function test(){
   //somthing then call build
   build() //i want to call build function again in my code
}
</code></pre>

<p>How can I do this?
I tried this in angular: </p>

<pre><code>var buildRoot = (() =&gt; {

                $SubNode.get({
                    TypeID: vendorAdminService.NodeType.Category
                }, function(data: vendorAdminService.IGetNodeParameters) {
                    $scope.ProductTree = data.TreeNodeModelItem;
                    $scope.AjaxLoading = false;

                }, function(err) {
                    // alert(err)
                })
        })();
$mdDialog.show(confirm).then(function() {
                $Category.Remove(node.ID)
                buildRoot
            }, function() {

            }); 
</code></pre>

<p>but it does not work. 
Anybody can guide me??</p>