According to my knowledge angular follows mvc architecture as i can see in the components there is .ts file(model) and .html file(view) but where is the controller?
While using the Angular framework, it is necessary to understand a few basic terms which will constitue the application you create.
Component: A component is a resuable code, which is capable of performing a set of functions or providing a view based on certain inputs. These inputs are optional. The component may additionally emit events in order to inform its parent component of the changes which might have taken place due to a particular action such as a click.
I am not too Keen on using MVC notation but if we were to strictly choose,
the template would represent the View, class is the Controller & the Service (when it used to retrieve data) is the model.
Because Angular is a client side framework, the MVC pattern Angular follows may be called as MVVC (Model, View, View Controller).
There is no such thing controller in angular.
It's only have component, view, model, services
Component: Will play the role of the controller since it handle logic for the template
Template: Will handle the role view to display the data
Model: Entity model will play the role model in your app
Services: To handle logic for you making http request or doing some side effect in your code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With