title: AngularJS uibModal reusable function
body: <p>I couldn't come up with normal title. Sorry for that. <br />
  So the problem is that in a big project, with big business logic there are a lot of modals. And every new modal is the same code with little changes, like templateUrl, controller and such things. This is how pop up is getting called now:</p>
  
  <pre><code>return uibModal.open({
                      templateUrl: current.path + 'url.html',
                      controller: 'AppController',
                      windowClass: 'PopUp',
                      size: 'md',
                      resolve: {
                          disabled: [function () {
                              return scope.disabled;
                          }]
                      }
                  }).result.then(function( comment ){
                      record.comment = comment;
                  })
  </code></pre>
  
  <p>And this routine never ends. So what I'm interested in is - what is the best practice to reduce the same code(same to this situation) in your project? Should you use service? Or just create global function? </p>