Sharing Top Content from the Angular-sphere.

Can someone help me with understanding the link between AngularJS and Node.js? • /r/angularjs

  • hashbang urls are the result of a Single Page Application, which is what AngularJs give you.
  • The static part of the url is the entry point to your Single Page Application – hashbangs route you within that single page.
  • So I’ve been looking using AngularJS and Node.js recently to make a specialized news site, but I’m having a hard time understanding where Angular comes into this.
  • subreddit: subreddit find submissions in “subreddit” author: username find submissions by “username” site: example.com find submissions from “example.com” url: text search for “text” in url selftext: text search for “text” in self post contents self:yes (or self:no) include (or exclude) self posts nsfw:yes (or nsfw:no) include (or exclude) results marked as NSFW
  • Some developers like to use isomorphic page loading on Node because static pages can typically load faster and may be easier for some SEO indexing / crawlers.

So I’ve been looking using AngularJS and Node.js recently to make a specialized news site, but I’m having a hard time understanding where Angular…

@Beepop_Agency: Can someone help me with understanding the link between AngularJS and Node.js?:

So I’ve been looking using AngularJS and Node.js recently to make a specialized news site, but I’m having a hard time understanding where Angular comes into this.

The way I have it is basically when you visit a page, an http request is made to the web server to retrieve the data and then the Angular controller formats it and turns that into the actual view. But with this, everything is an AJAX request if I understand $http correctly, right? And if that’s the case, I can’t get around the hashbang routing that I have set up in my Angular files? I’ve been reading that it’s bad to use hashbangs for the URL, but if everything is an AJAX request, what other choice do I have?

What I originally thought I’d be doing was using sendFile with Node.js to send the html file that has Angular templating, but that isn’t possible to my understanding. Is there some way that I can use Node.js and Angular.js but have server-side page rendering? Is client-side rendering with AJAX calls and hashbang URLs inherently bad?

I’m somewhat new to web development (I started last semester with the LAMP stack), so my bad if anything (or everything) I said makes no sense!

I do not believe so, it may have been difficult for SEO at one point but I don’t think that is the case anymore. Some developers like to use isomorphic page loading on Node because static pages can typically load faster and may be easier for some SEO indexing / crawlers.

Node.JS is a JavaScript runtime environment that will execute your server side JavaScript code. This will include performing operations like querying a database and returning data for user accounts, product information etc.

AngularJS is a front end framework that creates a very responsive dynamic experience for the user, as the code is sent to the client and executed on their browser.

Now in Django, the best way of communicating to AngularJS is to use JSON via a REST api. This means that minimal data is needed to be transferred from the server to the client in order for the page to respond and be updated.

Can someone help me with understanding the link between AngularJS and Node.js? • /r/angularjs

Comments are closed, but trackbacks and pingbacks are open.