2

I creating a simple angularjs app. I've imported ngRoute module and 2 views - Home and Contact. Home view is defined with controller.

.when("/", {
    templateUrl: "home/home.html",
    controller: "HomeController"
})

I don't need to implement logic for Contact view, because there are only 1 form to contact with me, that can work very well without angular. Can I define a route view without controller? Like:

.when("/contact". {
    templateUrl: "contact/contact.html"
})

Is controller obligatory?

Zaprogramowany
  • 623
  • 1
  • 7
  • 10

1 Answers1

2

No controller is not obligatory. You can define a route without it