AngularJS view without controller

3.6k Views Asked by At

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?

1

There are 1 best solutions below

0
AudioBubble On

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