1

I'm trying (but failing) to loop through this object with an array, to print the skills below each category in order. This is the object:

[{"category":"Accreditation","skills":["Security Operations Level 100","ServiceNow Adaptive Implementation Framework - SAIF","ServiceNow Change Management Helsinki ","ServiceNow Incident Management Geneva","ServiceNow Performance Analytics Geneva","ServiceNow Platform Core Helsinki","ServiceNow Problem Management Helsinki ","ServiceNow Service Portal Helsinki","ServiceNow Technical Best Practices"]},{"category":"Certification","skills":["BA Diploma","ITIL Intermediate Qualification: Continual Service Improvement","ITIL Intermediate Qualification: Service Design","ITIL Intermediate Qualification: Service Operation","ITIL Intermediate Qualification: Service Strategy","ITIL Intermediate Qualification: Service Transition","ITIL v3 Foundation","PRINCE2","ServiceNow Application Developer","ServiceNow Implementation Specialist","ServiceNow System Administration ","ServiceNow System Administrator"]},{"category":"Industry Vertical","skills":["Automotive","Financial Services","Government","Healthcare","Logistics","Manufacturing","Pharmaceuticals","Retail"]},{"category":"Process","skills":["Agile Methodology","Asset Management","Change Management","Configuration Management","Contract Management","Cost Management","Event Management","Field Services Management","Financial Management","GRC","Go-live Coordination","Incident Management","Knowledge Management","Managed Documents","Problem Management","Project Management","Release Management","Request Fulfilment","SDLC","Service Level Management"]},{"category":"ServiceNow Applications","skills":["Asset Management","Change Management","Configuration Management","Contract Management","Cost Management","Event Management","Field Services Management","Financial Management","GRC","HR Case Management","Incident Management","Knowledge Management","Managed Documents","On-Call Rotation","Problem Management","Project and Portfolio Management","Release Management","SDLC","Security Operations","Service Level Management","Service Portfolio Management","Service Request Catalog","ServiceWatch","Skills Management"]},{"category":"ServiceNow Development","skills":["Business Rules","Client Scripts","Script Actions","Script Includes","Studio","UI Actions","UI Macros","UI Pages","UI/Data Policies","Widgets"]},{"category":"ServiceNow Platform","skills":["API's","Access Control Lists (ACLs)","Connect","Content Management","Data model","Data sources and Import Sets","Development studio","Dictionary","Discovery","Edge Encryption","Forms and Lists","Homepages and Dashboards","Internationalisation","Mobile interface","Native reporting","Notifications","Performance Analytics","SLA Definitions","Scheduled Jobs","Service Catalog","Service Portal","Single Sign On (SSO)","Surveys and Assessments","Team Development","Transform maps/scripts","User Interface UI15","User Interface UI16","Web services","Workflows"]},{"category":"Soft Skills","skills":["Active Listening","Coaching","Collaboration","Communication","Conflict Resolution","Leading Virtual Teams","Mentoring","Negotiation","Presentation/Public Speaking","Prioritisation","Problem Solving","Risk Management ","Team Building","Time Management","Verbal Communication","Workshop Facilitation","Written Communication"]},{"category":"Special Skills","skills":["Pharmaceutical Skills"]},{"category":"Technical","skills":["AJAX","Angular","BMC Remedy","Big Data","Bootstrap","C#","CSS","Documentation Writing","Extract, Transform, Load (ETL)","HP Service Manager","HTML","Java","JavaScript","Jelly","Microsoft SQL Server","Oracle","Pentaho: Big data","PowerShell","Process Mapping","REST","Requirements Elicitation","Ruby","SOAP","SQL","Security","Service Implementation and Management (SIAM)","ServiceNow scripting ","SolarWinds","System Center Configuration Manager (SCCM)","System Center Operations Manager (SCOM)","Test Script Writing","Unix","VMWare","Wireframing/Mockups"]},{"category":"Test","skills":["Page Object Model - Automation"]}]

This is what I managed to get it to print, but it's not desirable:

Accreditation
["Security Operations Level 100","ServiceNow Adaptive Implementation Framework - SAIF","ServiceNow Change Management Helsinki ","ServiceNow Incident Management Geneva","ServiceNow Performance Analytics Geneva","ServiceNow Platform Core Helsinki","ServiceNow Problem Management Helsinki ","ServiceNow Service Portal Helsinki","ServiceNow Technical Best Practices"]
Certification
["BA Diploma","ITIL Intermediate Qualification: Continual Service Improvement","ITIL Intermediate Qualification: Service Design","ITIL Intermediate Qualification: Service Operation","ITIL Intermediate Qualification: Service Strategy","ITIL Intermediate Qualification: Service Transition","ITIL v3 Foundation","PRINCE2","ServiceNow Application Developer","ServiceNow Implementation Specialist","ServiceNow System Administration ","ServiceNow System Administrator"]
Industry Vertical
["Automotive","Financial Services","Government","Healthcare","Logistics","Manufacturing","Pharmaceuticals","Retail"]
Process
["Agile Methodology","Asset Management","Change Management","Configuration Management","Contract Management","Cost Management","Event Management","Field Services Management","Financial Management","GRC","Go-live Coordination","Incident Management","Knowledge Management","Managed Documents","Problem Management","Project Management","Release Management","Request Fulfilment","SDLC","Service Level Management"]
ServiceNow Applications
["Asset Management","Change Management","Configuration Management","Contract Management","Cost Management","Event Management","Field Services Management","Financial Management","GRC","HR Case Management","Incident Management","Knowledge Management","Managed Documents","On-Call Rotation","Problem Management","Project and Portfolio Management","Release Management","SDLC","Security Operations","Service Level Management","Service Portfolio Management","Service Request Catalog","ServiceWatch","Skills Management"]
ServiceNow Development
["Business Rules","Client Scripts","Script Actions","Script Includes","Studio","UI Actions","UI Macros","UI Pages","UI/Data Policies","Widgets"]
ServiceNow Platform
["API's","Access Control Lists (ACLs)","Connect","Content Management","Data model","Data sources and Import Sets","Development studio","Dictionary","Discovery","Edge Encryption","Forms and Lists","Homepages and Dashboards","Internationalisation","Mobile interface","Native reporting","Notifications","Performance Analytics","SLA Definitions","Scheduled Jobs","Service Catalog","Service Portal","Single Sign On (SSO)","Surveys and Assessments","Team Development","Transform maps/scripts","User Interface UI15","User Interface UI16","Web services","Workflows"]
Soft Skills
["Active Listening","Coaching","Collaboration","Communication","Conflict Resolution","Leading Virtual Teams","Mentoring","Negotiation","Presentation/Public Speaking","Prioritisation","Problem Solving","Risk Management ","Team Building","Time Management","Verbal Communication","Workshop Facilitation","Written Communication"]
Special Skills
["Pharmaceutical Skills"]
Technical
["AJAX","Angular","BMC Remedy","Big Data","Bootstrap","C#","CSS","Documentation Writing","Extract, Transform, Load (ETL)","HP Service Manager","HTML","Java","JavaScript","Jelly","Microsoft SQL Server","Oracle","Pentaho: Big data","PowerShell","Process Mapping","REST","Requirements Elicitation","Ruby","SOAP","SQL","Security","Service Implementation and Management (SIAM)","ServiceNow scripting ","SolarWinds","System Center Configuration Manager (SCCM)","System Center Operations Manager (SCOM)","Test Script Writing","Unix","VMWare","Wireframing/Mockups"]
Test
["Page Object Model - Automation"]

This is the HTML I used to achieve that:

<span ng-repeat="group in c.data.skillsAndCategories"> 
 {{group.category}}<br>
 {{group.skills}}<br>
</span>

This is how I fill the object:

skillsAndCategories.push({ 'category' : category, 'skills' : skills});

category is just a string while skills is an array. My goal is to print the array of skills without the brackets, quotations, etc. under each category.

Help would be appreciated! Thanks.

1 Answer 1

1

You should use two ng-repeats, as you have two arays.

<span ng-repeat="group in c.data.skillsAndCategories"> 
  {{group.category}}
  <span ng-repeat="skills in group.skills"> 
    {{skills}}
  </span>
</span>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.