I'm a newbie to angularjs, trying to add some functionality to angularjs codebase (angularjs 1.5 with angularjs material)
I don't see any module definitions angular.module
in the components.
All components js files start with class nameController
and end with an export export const namrComponent
.
What is the proper way of adding a component in such a case?
I mean how do you tweak an example like this to fit in the codebase.
I tried creating a component under app
folder and adding it to index.module.js
but it doesn't seem to work.
I get errors saying The controller with the name 'nameOfMyComponent' is not registered
I'm also trying to put md-switch
in one component (FirstComponent), and when its ng-change
is fired I want another component (SecondComponent) to create md-dialog
with md-list in it.
(SecondComponent) dialog will show a list of items with checkboxes, on hitting a submit button it will send the selected items to api; and return a success message to the (FirstComponent) to update the md-switch.
Is this flow possible? I mean the communication between components?
How to call one component from the other?