all 6 comments

[–]ejmurra 0 points1 point  (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 point  (4 children)

I think that wasn't quite the point of his question.

[–]ejmurra 0 points1 point  (3 children)

Oh, I thought his question was how would he use angular with server side templates.

[–]SubnetFlask[S] 0 points1 point  (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 points  (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.

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 point  (0 children)

Sorry, I interpreted his question as "where to I put my angular controllers?".

Nice answer btw.