私は多くの相互参照を持つ2つのコンポーネントを持っています。AngularJS:コンポーネント内の相互依存性
taskList
コンポーネント:
angular.module("todo-feature")
.component("taskList", {
templateUrl: "feature/todo-feature/todo_table.html",
controller: "Todo",
require: {
"parent": "paging"
}
});
paging
コンポーネント
angular.module("paging-module")
.component('paging', {
templateUrl: "feature/todo-feature/paging/paging.html",
controller: "PagingController",
require: {
"parent": "taskList"
}
});
index.html
:それは動作しません
<paging></paging>
<task-list></task-list>
私は彼らがお互いに依存することにしました。 2つのエラーが表示されます:
Controller 'paging', required by directive 'taskList', can't be found!
Controller 'taskList', required by directive 'paging', can't be found!
どうすれば修正できますか?良い建築ですか?あなたは何をお勧めします?
を実装します。彼らは兄弟です。 – estus