Angular notes


Usually when developing software, there is always a main which represents the point of entry for the program. Main is the starting point where you import/include the rest of your program.

However, for Angular, we have module, which kind of acts as main. It is a container for different part of your web.

name of the module – userService
array of other modules that your module may need – []

In this example, we are creating module userCtrl, which uses module userService

Angular Services

Services are written as a module to be provided for controllers to be use.
Notice that we first declare ‘userService’ as part of the module. It does not rely on any other modules, hence the empty array parameter.

It simply gets the $http variable and uses its HTTP verbs to retrieve information from the web service urls.