// in the following directive, replace flag generates multidir error, so done manually
.directive('mwControlButton',['$compile',function($compile){
return {
restrict:'E',
compile: function(tElement,tAttrs) {
// defer compilation to link function
var $content = $('<md-button>'+tElement[0].innerHTML+'</md-button>');
tElement[0].innerHTML = '';
// merge attributes from parent
$content.attr('something','something'); // test
// return link function
return function(scope,element){
// monitor memory leaks here for scope -- but so far does not appear to be problem
var content = $compile($content)(scope);
element.replaceWith(content);
}
}
}
}]);