Reputation: 3784
export class PickGroupService {
channelList: any[];
pick5West = ['783', '679', '934', '946', '800'];
thePicks: any[];
constructor(private channels: ChannelsService) { this.channelList = this.channels.getChannels(); }
getPickSet(pick, region) {
if (pick === 'pick5') {
switch (region) {
case 'west':
for (let i = 0; i < this.pick5West.length; i++) {
this.thePicks.push((this.channelList.filter(x => x.pickCode === this.pick5West[i]));
}
console.log(this.thePicks);
}
}
} } Just wondering whats wrong with this code, it says : ERROR TypeError: this_1.thePicks is undefined on browser console. Please advise!
Upvotes: 0
Views: 52