By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,114 Members | 759 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,114 IT Pros & Developers. It's quick & easy.

Are node.js controllers essential?

P: 97
I'm trying node.js for the first time and I'm liking it so far. I've made a simple little header for a web app. On the header there's a login button that has a dropdown with with two links; one for login and the other for sign up.

I'm using a very basic Angular data initialization instead of a controller. There's also a repeat to fill the list for the dropdown. I'm reading that initialization is rarely used but my needs are so basic that I'm wondering if I really need a controller.

Here's some of the code:

Expand|Select|Wrap|Line Numbers
  1. section.header-nav(ng-app="" ng-init="loginlist=['Login','Sign Up']")
  2.   #[button.login-button(type='button') Login #[ul #[li(ng-repeat="x in loginlist") #[{{ x }}]]]]
Keep in mind this is written in Jade (just in case you couldn't tell).

Basically, I'm wondering if there's some functionality I might be missing by not using a controller.
Sep 25 '15 #1
Share this Question
Share on Google+
2 Replies

P: 305
As per my understanding and knowledge , yeah they are essential, as they represent a data along with some functionalities to implement like sign up, authentication and authorization.
Sep 25 '15 #2

P: 97
Ok, Thanks. I'll get around to making some better functionality soon.
Sep 25 '15 #3

Post your reply

Sign in to post your reply or Sign up for a free account.