I am new to AngularJS with FireBase as my data store. I have gone through the examples on their website. Now, I would like to expand on the simple concepts and create a more detailed application.
Let's say, for example, I have a recipe controller. This would contain the recipe name and a short description. But, I also want to have a list of ingredients along with their quantities.
The ingredients would be a select element with a list of available ingredients to choose from.
My question is, how do I utilize multiple controllers on a CRUD site? Or should I not use multiple controllers and somehow use the recipe controller to handle everything?
If I were doing this by creating the database schema in, say, MSSQL I would have no problem and would know exactly what to do. I think it's the fact that everything is client-side that is throwing me off.
Thanks in advance for any assistance provided.
You probably won't want to have a controller per entity. You're controller here maps to a scope object. The scope is then bound to a view - keeping them in sync.
So if your view displays a recipe (i.e name/description), it might also have a child property ingredients ($scope.recipe.ingredients).
You're controller will manage this 'recipe' object, and also provide methods to modify/retrieve/manage it. Say for example you want to save the $scope.reciepe object to your FireBase store - you can inject a service into your controller, and then make a $http call to 'put' that object into your db.
A brief conceptual overview of control
See more at https://docs.angularjs.org/guide/controller