I have a directive that has an attirbute, it looks like this:
<directive config="myConfig"></directive>
This is my directives code:
app.directive("directive", ["$compile", ($compile) => {
return {
scope: {"config":"="},
template: "<div></div>",
link: function(s,e,a) {
// I want my scope here so I could use $compile to compile a directive into it
// ('it' being the scope the directive lives in).
// Yet I also want the config variable so I could $watch it.
}
}
});
As shown, I want the config variable and the entire scope, is there a way to do this?
Thanks.