I'm using angularjs and requirejs to load my controllers only when they are needed.
In one of my controllers I'm using angularstraps $modal for modal boxes.
In myCtrl1 you can find the functions which close and open the modal box.
In myCtrl2 I am requiring modal.js only if the controller is referenced on the page but it looks its failing to be able to reference $modal and returns the error:
Unknown provider: $modalProvider <- $modal
Plunkr here: Link
Main files are index.html, controllers.js and modal.js
Looks like angularstrap's directives have not been loaded - somewhere you need to add them to the app, e.g. var app = angular.module('myapp', ['$strap.directives']);