I have the following service:
myapp.service('myService', function () {
var familyList = this;
familyList.people = [
{ name: 'Jax', dob: '01/01/1974', cell: '3035551212', carrier: 'ATT', email: 'jax@soa.com', active: true },
{ name: 'Tara', dob: '03/01/1974', cell: '3035551313', carrier: 'SPRINT', email: 'tara@soa.com', active: false }];
});
I have the following directive:
myapp.directive('applyplugin', function () {
return {
link: function ($scope, myService) {
$scope.myService = myService;
alert(myService.people.length);
$("select[id^='ms']").each(function () {
$(option).remove();
});
}
}
});
Can I reference the familyList array from the directive?