There is no strict API for defining how systems manage components. A common pattern is to have components subscribe themselves to the system. The system then has references to all of its components:
AFRAME.registerSystem('my-component', {
init: function () {
this.entities = [];
},
registerMe: function (el) {
this.entities.push(el);
},
unregisterMe: function (el) {
var index = this.entities.indexOf(el);
this.entities.splice(index, 1);
}
});
AFRAME.registerComponent('my-component', {
init: function () {
this.system.registerMe(this.el);
},
remove: function () {
this.system.unregisterMe(this.el);
}
});