I'm having trouble linking two brother components in angularJS without using a service. I saw examples but I can not make them work. This is what I have. What am I failing? Thanks!
cluster.js
<div class="row">
<filter-component></filter-component>
<result-component filters="$ctrl.filters"></result-component>
</div>
filter.component.js
'use strict';
angular
.module('filter' , ['ui.bootstrap'])
.component('filterComponent', {
bindings: {},
templateUrl : 'app/filter/filter.html',
controller : filterCtrl
})
function filterCtrl($scope){
this.filters = 'FILTRO' // <-- I give it a value
}
results.component.js
(function(){
'use strict';
angular
.module('result')
.component('resultComponent', {
bindings: {
filters :'<' // <-- inject
},
templateUrl : 'app/result/result.html',
controller : resultCtrl
})
function resultCtrl($scope) {}
result.html
<h1>{{$ctrl.filters}}</h1> //<-- nothing is shown :(