I successfully managed to compile a directive using this piece of code:
let element, $injector, $compile, link, scope;
element = angular.element(document.getElementById(#whatever));
$injector = element.injector();
$compile = $injector.get('$compile');
link = $compile(angular.element('<my-directive></my-directive>'));
scope = element.scope();
scope.foo = 'foo'; // My intention is to put this on the isolate scope!
element.append(link(scope));
The directive in question has an isolate scope. While the scope
variable mentioned above refers to the parent element's scope, I am looking for a way to access the isolate scope of the directive itself. Any suggestions?