Answer the question
In order to leave comments, you need to log in
Why doesn't Alight respond to state changes?
in theory this should work:
<div al-app="mainCtrl" >
<div al-init="search={}">
Name: <input type="text" al-value="search.name" /> <br/>
Age: <input type="text" al-value="search.age" /> <br/>
</div>
<table class="table table-bordered">
<tr al-repeat="it in list | smart:search">
<td>{{=it.name}}</td>
<td>{{=it.age}}</td>
</tr>
</table>
</div>
<div al-app="mainCtrl" >
<div al-init="search={}">
Name: <input type="text" al-value="search.name" /> <br/>
Age: <input type="text" al-value="search.age" /> <br/>
</div>
<table class="table table-bordered">
<tr al-repeat="it in list | smart:search.name">
<td>{{=it.name}}</td>
<td>{{=it.age}}</td>
</tr>
</table>
</div>
alight.controllers.mainCtrl = function(scope) {
scope.list = [{name:'Alex',age:35},{name:'Masha',age:28}];
};
alight.filters.smart = function (name, scope) {
console.log(name, scope);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question