У меня есть директива, которая имеет attirbute, он выглядит следующим образом:AngularJS: Попутный в функцию директивы ссылки атрибут И весь объем
<directive config="myConfig"></directive>
Это моя директива код:
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.
}
}
});
Как показано, мне нужна переменная конфигурации и весь объем, есть ли способ сделать это?
Спасибо.