ng-R
ng-R

Reputation: 757

Defining a controller at the app module

I have an app module, want to register a controller for app module. Is it ok to define a controller for the app module?

Regards, ng-R

Upvotes: 0

Views: 45

Answers (1)

JB Nizet
JB Nizet

Reputation: 691785

You can organize your components in modules the way you want. For a very small app, you can imagine using a single app module containing all the components. For larger applications, splitting components in technical and/or functional modules is a good idea.

In the end, at runtime, what matters is that the needed controller is part of the app module or of any of the modules it depends on, transitively.

Upvotes: 1

Related Questions