Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<li class="no-decoration" ng-repeat="tech in technologyArray">
<label>
<input type="checkbox" ng-model="tech.on" />{{tech.name}}</label>
{{tech.on}}
</li>
<hr>
<div ng-repeat="portfolioItem in portfolioArray | filter:myFunc" class="ng-scope">
<h3>{{portfolioItem.name}}</h3>
</div>
</div>
JavaScript
var myApp = angular.module('myApp', []);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.myFunc = function(a) {
for(tech in $scope.technologyArray){
var t = $scope.technologyArray[tech];
if(t.on && a.technology.indexOf(t.name) > -1){
return true;
}
}
};
$scope.technologyArray = [{ name: "HTML", on: false}, {name:"CSS", on:false}];
$scope.portfolioArray = [{
"id": "1",
"name": "Storm Pig",
"technology": ["HTML"]
}, {
"id": "2",
"name": "Placer",
"technology": ["HTML", "CSS"]
}, {
"id": "3",
"name": "Custom Proposal App",
"technology": ["HTML"]
}, {
"id": "4",
"name": "21 Zero",
"technology": ["CSS"]
}, {
"id": "5",
"name": "Detour Journal",
"technology": ["HTML", "CSS"]
}, {
"id": "6",
"name": "Dex Custom Websites",
"technology": ["HTML"]
}, {
"id": "7",
"name": "Conversion Jump",
"technology": ["CSS"]
}, {
"id": "8",
"name": "The Canyons Pass",
"technology": ["HTML", "CSS"]
}]
}