I\'ve copied and pasted the example code from twitter bootstrap to create a basic modal window in my Rails 3.2 app:
If you are using angular and trying to create a directive that has a custom modal in it, the modal backdrop will show but the modal itself will not unless you set replace: true on your directive.
Typescript Directive:
export class myModalDirective implements ng.IDirective {
static Register = () => {
angular.module('app').directive('myModal', () => { return new myModalDirective () });
}
templateUrl = 'mymodal.html'
restrict = 'E';
replace = true;
scope = {
show: '='
}
link = (scope: any, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, ctrl: any) => {
var vm = this;
scope.$watch(function () { return scope.show; }, function (vis) {
if (vis) {
$(element).modal('show');
} else {
$(element).modal('hide');
}
});
}
constructor () {
}
}
Modal HTML