Just getting started with Ionic and decided to work on a book library app for internal use. Here's a link to my Plunker.
All my book data is stored in a JSON file in services.js. It's a nested JSON structure with different book categories, each category containing multiple books. I've successfully extracted the category information and displayed them in a list using ng-repeat.
My goal is to have the ability to click on a category, which will then take you to a page displaying all the books within that category (template file chat-detail.html). From there, clicking on a specific book should open up a detailed view (still need to create the template).
I'm trying to retrieve the category name with the following code:
get: function(catname) {
for (var i = 0; i < chats[0].categories.length; i++) {
if (chats[0].categories[i].catname === catname) {
return chats[0].categories[i];
}
}
return null;
}
After doing a console.log, I can confirm that the array is being returned as expected.
However, when clicking on the category list, nothing happens. The error message displayed is not very helpful, starting with "Injector unpr" and followed by a long list of lines. According to AngularJS docs, this is related to mismatched controller names, but I've double-checked my names and they seem correct to me.
I've been stuck on this issue for the entire week, so any help would be greatly appreciated.
You can make direct modifications to my code here. I have a hunch that the problem lies within my controllers.js file, but I'm not sure where exactly.