Are node.js controllers essential?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tdrsam
    New Member
    • May 2015
    • 97

    Are node.js controllers essential?

    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:

    Code:
    section.header-nav(ng-app="" ng-init="loginlist=['Login','Sign Up']")
      #[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.
  • madankarmukta
    Contributor
    • Apr 2008
    • 308

    #2
    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.

    Comment

    • tdrsam
      New Member
      • May 2015
      • 97

      #3
      Ok, Thanks. I'll get around to making some better functionality soon.

      Comment

      Working...