问题
I want use the "transcludeControllers" property present as argument of $compile function of angular (at the end of https://docs.angularjs.org/api/ng/service/$compile page ) I've some problem. I made a jsfiddle.
https://jsfiddle.net/qq4gqn6t/5/
$element.append($compile('<son></son>')($scope, undefined, {
transcludeControllers: {
dad: this
}
}));
But it does not seem to work
Work only if I uncomment the 42 row
//templateUrl: 'sonTemplate.html'
Another solution is
https://jsfiddle.net/qq4gqn6t/6/
Have some ideas?
Thanks in advance
来源:https://stackoverflow.com/questions/34849645/how-use-transcludecontrollers-in-angularjs