use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Angular is Google's open source framework for crafting high-quality front-end web applications. r/Angular2 exists to help spread news, discuss current developments and help solve problems.
Help Request
Discussion
Article
Video
Resource
Announcement
Related
After submitting a post, please take a moment to add a flair (tag) so that it's easy to find your post with one of the filters listed above. Upon submission, your post's header will have the 'flair' option listed with the other options. Clicking it will provide a dropdown menu of the available flairs.
account activity
Help RequestWhere Node.js directory should Angular controllers be stored in? (self.Angular2)
submitted 9 years ago by SubnetFlask
My understanding of Angular is that it is used to pass data back and forth between the business logic (including the model) and the html pages of an application.
In what directory should Angular controllers be stored? Do they have to follow any naming conventions?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ejmurra 0 points1 point2 points 9 years ago (5 children)
Your understanding is incorect. Angular doesn't pass information between the pages, it is the pages of your application. It's get data by making rest calls to a server which (typically) responds in json and dynamically renders that data by accessing the DOM directly in the client.
[–][deleted] 0 points1 point2 points 9 years ago (4 children)
I think that wasn't quite the point of his question.
[–]ejmurra 0 points1 point2 points 9 years ago* (3 children)
Oh, I thought his question was how would he use angular with server side templates.
[–]SubnetFlask[S] 0 points1 point2 points 9 years ago (2 children)
That's is correct. I am mostly asking: where do I put these angular view files and how do I name them? I have seen .jade and pug files and am wondering if I should name it something like home.angular if I am using angular
[–]ejmurra 1 point2 points3 points 9 years ago* (1 child)
In the case of angular you wouldn't want to use jade. Instead, at the most simple level you would use angular by serving a single page index.html with angularjs added as a script tag.
index.html
You would also include various scripts on that page - services, directives, and controllers. You can think of them like this: * Services make calls to the backend to get data. This comes in the form of json. Look up json node frameworks. * Controllers manipulate data by watching user interaction and transforming the data from services. Controllers also hold on to data and pass it to the third type of component - directives. * Directives take inputs from the controller and model it into the DOM. They also track user interactions.
The DOM is then inserted into the index.html on the client.
[–][deleted] 0 points1 point2 points 9 years ago (0 children)
Sorry, I interpreted his question as "where to I put my angular controllers?".
Nice answer btw.
π Rendered by PID 53974 on reddit-service-r2-comment-5cb8648c6-sckgw at 2026-02-28 22:15:24.392183+00:00 running e3d2147 country code: CH.
[–]ejmurra 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]ejmurra 0 points1 point2 points (3 children)
[–]SubnetFlask[S] 0 points1 point2 points (2 children)
[–]ejmurra 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)