Zaprogramowany
Zaprogramowany

Reputation: 713

AngularJS view without controller

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?

Upvotes: 3

Views: 3624

Answers (1)

user4066693
user4066693

Reputation:

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

Upvotes: 3

Related Questions