Ceci est une ancienne révision du document !
In staying with the theme of the last few articles of C&C, I will be introducing two new JavaScript frameworks for web development. AngularJS, which is all client-side, and Meteor - which can be both client-side and server-side. After all this focus on content management systems, I felt it was necessary to mention a few smaller tools which can help add features to static web pages, without having to use a CMS, or creating massive amounts of custom code.
What is AngularJS?
AngularJS is a framework designed to make the creation of client-side web applications easier. It integrates into HTML by adding to its syntax. It allows things such as replacing content without reloading a page, simplifying testing, and offering optimizations to how JavaScript is loaded.
What is the difference between AngularJS and something like NodeJS?
NodeJS is a framework that acts both as a server, as well as a web application in general. This means many things are possible in both systems, but NodeJS won’t integrate into a normal static HTML page. As AngularJS is included into a web page in the normal fashion (with a <script> tag), it can be added into any web project.
Where can I start learning AngularJS?
AngularJS is included in Code School’s list of courses. For anyone who doesn’t know Code School - it’s a website that offers videos and exercises for learning programming languages. As everything is done in the browser in real-time (including the programming exercises), you’re able to easily check your work, or re-watch sections of the videos to better understand concepts. The AngularJS course is free, and an excellent introduction. For those of you who learn best by doing, you can follow along with the videos in a text editor, and then simply answer the exercises once you reach that stage.
Why mention Meteor then?
Meteor is an open source system for creating web and apps in pure JavaScript, and offers libraries to make designing the application faster and more efficient. The main difference is that Meteor also offers a Node.JS-based server for running your code, which is integrated with other applications to make deploying a production system easier, among other things.
Why choose one or the other?
It depends on the scope and aim of the project. If you have a static HTML page, and want to simply add some modern features to it (no refresh, or making certain content dynamic), then AngularJS is best. This is because it can be added into the existing HTML page, and is relatively lightweight.
If you’re writing an entire application from scratch, and need systems in place on both the server and the client side, you’ll be better suited to Meteor. The same is true if you’re deploying a web application on various devices (phones, tablets, desktops), and it will be more than just an HTML page with some dynamic content.
Lastly, it boils down to personal choice. If both AngularJS and Meteor can do the things you need, pick the one that you like the look of best. If the extra features of Meteor appeal to you, use it.
What about a CMS?
As AngularJS is not a server-based framework, however, there are some CMS that integrate it into their systems. As AngularJS integrates easily into existing webpages, you could technically use it with any CMS you may already know. In the case of Meteor, there are some CMS that I’ve seen: OrionJS, Meteor-Admin, or Azimuth. I have not used any of them, and they seem to vary in size and complexity. Depending on the size of the project, and on what features of a CMS you may need, simply creating a custom system in Meteor may be easier and faster.
Will you write a tutorial on either AngularJS or Meteor in a C&C article?
As AngularJS is featured in Code School, I feel an article focused on this would be a duplication of effort. However, if there are specific questions, I will be happy to answer them. Also, if there is enough interest in an article on Meteor, I will happily write that too.
Hopefully this has enthused some readers to give AngularJS and Meteor a shot in some of their existing (and/or future) projects. If you run into any specific issues, or are interested in a proper tutorial on Meteor, feel free to send me an email at the following address. Also, if anyone has any questions, suggestions, or requests for C&C articles in general, feel free to email me at lswest34+fcm@gmail.com.
Further Reading
https://angularjs.org/ - Official homepage of AngularJS
http://campus.codeschool.com/courses/shaping-up-with-angular-js/ - Code school free AngularJS course
https://www.meteor.com/ - Official homepage of Meteor