I have this controller:
(function () {
"use strict";
angular.module("workPlan").controller("genericFilterDataController", ["$scope", genericFilterDataController]);
function genericFilterDataController($scope) {
$scope.data = ['bla1', 'bla2', 'bla3'];
$scope.foo = function () {
};
}
})();
When function foo is fired I want to generate properties in $scope with names listed in the data array.
For example:
In function foo I want to create properties with names according to the strings in the data array:
$scope.bla1
$scope.bla2
$scope.bla3
How can I implement this?