title: Create general function to close modal angularjs
body: <p>I'm using Uikit/angularjs and i would create a general function to close the modals. Actually this is method:</p>
  
  <pre><code>$scope.closeDialog = function() {
              var modal = UIkit.modal("#myModalId");
              if ( modal.isActive() ) {
                  modal.hide();
              }
          };
  </code></pre>
  
  <p>and inside the modal i've got </p>
  
  <pre><code>&lt;button type="button" class="uk-button uk-button-primary" data-ng-click="closeDialog()"&gt;Close&lt;/button&gt;
  </code></pre>
  
  <p>It works, but in this way i need create always a new function for every single Modal.. Is there a way to generalize this function maybe pass to the function the id of the dialog? I created a jsfiddle and strangly seems not working even if i get the exaclty id:
  <a href="http://jsfiddle.net/8y48q/62/" rel="nofollow">http://jsfiddle.net/8y48q/62/</a></p>