Assignment 3 for my project is an AngularJS-based application designed to simplify menu searching. This application streamlines the process of finding specific menu items by allowing users to input keywords and instantly retrieve relevant results. The interface is thoughtfully crafted to be user-friendly, with clear instructions and intuitive controls. By leveraging AngularJS's powerful features, such as two-way data binding and dependency injection, the application provides a seamless and responsive user experience.
At its core, the application consists of a controller, service, and directive. The controller, named NarrowItDownController, orchestrates the search functionality and interacts with the service, MenuSearchService, to fetch menu items from a RESTful API endpoint. The service handles the HTTP requests and filters the menu items based on the user's search term. Once the relevant items are retrieved, they are displayed in a list format using the foundItems directive.
One of the key features of the application is the ability to remove unwanted items from the search results. This functionality is implemented using the on-remove attribute of the foundItems directive, which communicates with the controller to remove items from the list when the user clicks the "Don't want this one!" button. This feature enhances the user experience by allowing users to refine their search results and focus on items that meet their preferences.
Overall, Assignment 3 demonstrates the power and versatility of AngularJS in developing dynamic web applications. By following best practices such as encapsulating code within an IIFE and protecting dependency injections from minification, the application maintains clean and maintainable code. Despite its simplicity, Assignment 3 showcases the fundamental principles of AngularJS development and provides a solid foundation for building more complex applications in the future.