Answer the question
In order to leave comments, you need to log in
Auto-defined directive?
It's complicated. So there is something like an editor. Block. That is, you can insert blocks of different types into it and swap them. For example, a text block, a heading block, a list block, a separator block.
The editor is a directive, and blocks are also directives. For example, we have a text variable.
$scope.text = [{
"type": "title",
"state": "preview",
"content": {
"level": 1,
"text": "Это начало статьи"
}
}, {
"type": "markdown",
"content": {"text": "Теперь работаем надо самим уроком."},
"state": "preview"
}]
<editor>
<block>
<title content="content" />
</block>
<block>
<markdown content="content" />
</block>
</editor>
Answer the question
In order to leave comments, you need to log in
Well, what comes to me:
1) Make a service responsible for connecting directives.
2) When a directive module is connected, it registers itself in the service.
3) The parent directive through the service understands which blocks it can manipulate.
about weather data, why not pass them as attributes?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question