I currently am working on a project that involves 2 different directives:
<div ng-controller="indexViewModel">
<div class="row">
<searchfilters></searchfilters>
</div>
<div class="row top-buffer">
<searchfields></searchfields>
</div>
</div>
Both of these directives have a specified templateUrl
and call 2 separate services, each handling a list of items.
var SearchFiltersService= angular.module('SearchFiltersService', [])
.service('SearchFilters', function () {
this.MyList = [];
return this;
});
var SearchFieldsService= angular.module('SearchFieldsService', [])
.service('SearchFields', function () {
this.MyList = [];
return this;
});
As I face challenges like cyclical dependency issues, I'm realizing the need to rethink my approach. How can I effectively manage 2 templates, each associated with a service (managing a list of items), where changes made in one service are reflected in the other service (and vice versa)?