$transclude is not a function
.directive('modalTransclude', function () {
return {
link: function($scope, $element, $attrs, controller, $transclude) {
$transclude($scope.$parent, function(clone) {
$element.empty();
$element.append(clone);
});
}
};
})
upon trying to open a modal I am getting the TypeError:
TypeError: $transclude is not a function
at link (http://localhost:3000/static/bootstrap.js:1918:9)
at nodeLinkFn (http://localhost:3000/static/angular.js:5435:13)
at compositeLinkFn (http://localhost:3000/static/angular.js:4911:15)
at nodeLinkFn (http://localhost:3000/static/angular.js:5429:24)
at compositeLinkFn (http://localhost:3000/static/angular.js:4911:15)
at nodeLinkFn (http://localhost:3000/static/angular.js:5429:24)
at http://localhost:3000/static/angular.js:5589:13
at http://localhost:3000/static/angular.js:6672:11
at wrappedCallback (http://localhost:3000/static/angular.js:9769:81)
at wrappedCallback (http://localhost:3000/static/angular.js:9769:81) <div class="modal-content" modal-transclude="">
Anyone know how this could originate? Thanks :-)
plunkr please
@nikkwong https://github.com/angular-ui/bootstrap/blob/master/CONTRIBUTING.md#you-think-youve-found-a-bug
My apologies. ^_^
http://plnkr.co/edit/uIOIOQEnz6528HavV4s5?p=preview
Thanks!
Thanks for the plunker @nikkwong. But I can now conclude that this is a support question rather than a bug in modal.
A word of advise -- get back to the core basics of opening the modal from a controller. When that works, slowly build up your directive again and see when you get the error.
Hi, sorry don't mean to re-open, but even in the most simple documented use case this error is still being generated.
http://plnkr.co/edit/uIOIOQEnz6528HavV4s5?p=preview
This is not an issue if you use a more recent version of AngularJS:
http://plnkr.co/edit/gBMGMZ2uGD1Ek9HRGJxP?p=preview
In the upcoming 0.13.0 release, AngularJS 1.3 will be the minimum requirement.
@nikkwong you are using very old AngularJS version, the err goes away if you switch to the latest released 1.2.x: http://plnkr.co/edit/itF3gPyBjQKEJCQFaePX?p=preview
Tks :-)
Just in case, if you wanna keep using the older AngularJS version and use the latest angular bootstrap, just search for modal-transclude and replace with ng-transclude or better way just override the module in your app.js and change modal-transclude to ng-transclude.
angular.module("template/modal/window.html", []).run(["$templateCache", function($templateCache) { $templateCache.put("template/modal/window.html", "< div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10, display: 'block'}" ng-click="close($event)">\n" + " < div class="modal-dialog" ng-class="{'modal-sm': size == 'sm', 'modal-lg': size == 'lg'}">< div class="modal-content" ng-transclude>< /div>< /div>\n" + "< /div>"); }]);
This is a work around, hope this helps :)