I am getting an error!!!
Fatal Error!
skills.ForEach is not a function
*Skill.model.ts*
--------------
export class Skill {
constructor(skillname?: string, skilltype?: number) {
this.skillname = skillname;
this.skilltype = skilltype;
}
public id: number;
public skillname: string;
public skilltype: number;
}
*API return function*
-------------------
onResult(skills: Skill[]) {
this.loadingIndicator = false;
*skills.forEach*((skill, index, skills) => {
(<any>skill).index = index + 1;
});
this.rows = skills;
}
*skills object array*
-----------------------
Object {skills: Array(35)}
skills:Array(35) [Object, Object, Object, …]
length:35
__proto__:Array(0) [, …]
0:Object {id: 1, skillname: ".NET", skilltype: 3}
1:Object {id: 2, skillname: "PHP", skilltype: 3}
2:Object {id: 3, skillname: "Python", skilltype: 3}
3:Object {id: 4, skillname: "Cold Fusion", skilltype: 2}
4:Object {id: 5, skillname: "SQL Server", skilltype: 4}
5:Object {id: 6, skillname: "My SQL", skilltype: 4}
6:Object {id: 7, skillname: "Mongo", skilltype: 4}
7:Object {id: 8, skillname: "JQuery", skilltype: 5}
8:Object {id: 9, skillname: "Node JS", skilltype: 5}
9:Object {id: 10, skillname: "Angular", skilltype: 5}
10:Object {id: 11, skillname: "Bootsrap", skilltype: 2}
11:Object {id: 12, skillname: "Photoshop", skilltype: 2}
12:Object {id: 13, skillname: "C#", skilltype: 3}
13:Object {id: 14, skillname: "Django", skilltype: 7}
14:Object {id: 15, skillname: "SQL Lite", skilltype: 4}
15:Object {id: 16, skillname: "HTML 5", skilltype: 1}
16:Object {id: 17, skillname: "CSS", skilltype: 1}
....
....
__proto__:Object {constructor: , __defineGetter__: , __defineSetter__: , …}
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.