I have a form that is structured into different sections as shown below:
education: {faculty: "", high_school: ""}
experience: {experience_1: "", experience_2: "", experience_3: ""}
personalInfo: {id: "", type: "", email: "", password: "", password_new: "", first_name: "", last_name: "",…}
skills: {skill_1: "", skill_2: ""}
All inputs are generated using ngRepeat directive.
<div ng-repeat="(key, val) in user" >
<div ng-repeat="(k,v) in val | filter:filterBySection" class="formParameter" >
<span class="param_label">
{{k}}:
</span>
<span e-class="form-control " class="formParameterValue" editable-text="user.{{key}}.{{k}}" e-name="{{k}}">{{v}}</span>
</div>
</div>
My question is how can I create a filter to display only the selected section. For instance, if I click on the education button, it should only show 'faculty' and 'high school'
<li ng-repeat="(a,b) in user" ng-click="filterBySection = ?:{{a}}" ng-model="filterBySection"><a href="#">{{doc_param}}</a></li>
Your suggestions on implementing this feature would be greatly appreciated.