Click here to load reader

5 Things To Know Before You Get Started With AngularJS

Embed Size (px)

DESCRIPTION

Navigating the AngularJS landscape can be a daunting experience. While the library itself is fairly robust, choices early in the adoption process can have drastic long-term effects on your software development process. Below we present five things that you should know about AngularJS. This information won’t solve every problem you’ll have with the library, but it can help you get off on the right foot.

Citation preview

  • 1. 5 Things To Know Before You Get StartedWith AngularJSNavigating the AngularJS landscape can be a dauntingexperience. While the library itself is fairly robust, choices earlyin the adoption process can have drastic long-term effects onyour software development process. Below we present fivethings that you should know about AngularJS. This informationwont solve every problem youll have with the library, but itcan help you get off on the right foot.1. AngularJS is Entirely Client-SideAngularJS is written in JavaScript, and it functions entirely on the client side.This means two things for your app. First, you can run AngularJS in any browserthat can execute JavaScript, making deployment a snap. Secondly, you candrop AngularJS into any project without significant back-end modifications.This greatly reduces the risk in adopting AngularJS for the front-end displayof your app. AngularJS is built off of HTML attributes, making enablingprocessing of data a fairly quick process, though in order to use AngularJSeffectively youll likely have to rewrite a portion of your presentation layer.www.backand.com

2. 2. AngularJS is Focused on DataAngularJS is designed to separate your presentation layer from your businesslogic layer. It ties the HTML structure of a web page into underlying JavaScriptdata models, and allows the app to make significant changes to the datawithout performing the typical extensive DOM manipulations used in otherJavaScript libraries. AngularJS follows a Model-View-Controller (MVC) pattern,which encourages loose coupling between presentation, data, and logic. Thedata for a page in an AngularJS application can come from any of the standardlocations, including static or dynamic JSON data obtained from a server or aweb API call, as well as being hard-coded into the page.3. AngularJS Provides a Declarative UIMost modern apps use JavaScript in various ways to present and manipulatethe applications data. This leads to convolutions in logic where the HTMLof a web page needs to be nearly constantly modified and rebuilt in order topresent information developed using the procedural programming inherent inJavaScripts design. AngularJS, on the other hand, takes a declarative approachto data presentation that more closely mimics the intent behind the design ofHTML. In essence, AngularJS lets you focus on what is presented, as opposedto the procedural focus on how it is presented.4. AngularJS Data Objects are POJOAll objects in AngularJS are POJOs, which stands for Plain Old Java(Script)Objects. What this means is that you have all the standard functionalityof JavaScript available for object manipulation, allowing you to easily addand remove properties from your objects, and make use of all the built-incollection handlers to loop through your data at will. This results in cleanercode that is more quickly understood by developers, and removes the needfor adding special case functions to your data objects in order to get thebehavior you want.5. AngularJS is Built for TestingUnit and functional testing produce more robust, dependable code. AngularJSwas developed with this ideal in mind, and is designed from top to bottomto make testing a relatively painless process. AngularJS uses DependencyInjection (DI) to pass information around, allowing your tests to easily overridethe function calls and inject appropriate mock data. This is important forwriting robust unit tests that isolate the functionality being tested. There arewww.backand.com 3. also a number of tools built into AngularJS, such as a mock HTTP provider, thatmake writing larger functional tests a more dependable endeavor. Finally,there are numerous open-source tools for running test suites in AngularJS,including Karma for running tests and Jasmine for behavior-driven testing.ConclusionAngularJS is a powerful tool which, when used correctly, can make yourpresentation layer both more maintainable and more robust. With its focuson data-presentation as a declarative effort, it more closely mimics HTMLand its robust interpretations across multiple scenarios. By keeping the aboveitems in mind, you can help direct your development organization in how ituses AngularJS to enhance your applications data presentation, and preventlong-term pitfalls that can add unnecessary costs and complexity to thedevelopment process.Looking to develop with AngularJS? Try Backand and get started immediately connect your database with cool customized directives in order to createbeautiful dashboards.www.backand.comContact InformationBackand [email protected]