can transclude and templateUrl work together in a directive?
I'm trying to make a dynamic modal directive that supports html.
modal.js
'use strict';
myApp.directive('siteModal', function($http) {
return {
restrict: 'A',
transclude: true,
templateUrl: "./components/modal/modal.html",
};
});
modal.html
<div class="site-modal">
<div class="site-modal-content">
<div class="site-modal-body">
{{modalContent}}
</div>
</div>
<div class="site-modal-overlay"></div>
</div>
Usage:
<div site-modal ng-transclude>
Hello World <strong>and maybe some HTML too!</strong>
</div>