Where is the controller in Angular 7 as it follows mvc architecture
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?
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
.ts is just the file extension which represents typescript file. model-name.model.ts is the the common way of naming model. Similarly, component-name.component.ts is for component, component-name.component.html for view and service-name.service.ts for service. Finally, as the earlier comment says, you can't directly relate MVC with angular architecture.
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
emitevents in order to inform its parent component of the changes which might have taken place due to a particular action such as a
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).