Preface

Application development is a broad term; it can range from developing the simplest static page of plain text to the most complex database-driven, electronic business, and social networking applications. A more comprehensive list of tasks that application development commonly refers to may include, web designing, content development, client relationships, client-side and server-side configurations, and deployments.

In the past, most developers developed server-side applications because of an available server-side framework called Windows Presentation Foundation (WPF) or web frameworks such as ASP.NET or Silverlight. These are used to create objects containing data and bind them to user interface controls such as HTML. However, improved browser features, faster JavaScript engines, and an increase in the usage of mobile devices, such as iPads, iPhones, and Android tablets have definitely shifted the trend from server-side to client-side development. However, data binding has been difficult to implement into client-side application development because neither HTML nor JavaScript natively support it.

It is possible to start client-side data binding from scratch; but, it is definitely challenging and possibly not the best solution available. It is also very difficult to maintain and reuse the code. To create a client-side application is an amazing ability, although, the complexity involved in creating it is high. To develop a client-side application involves manipulating the Document Object Model (DOM) in a browser running JavaScript. One of the benefits of client-side applications is that HTML (DOM) will be updated with the click of a button, rather than keeping a user waiting for the server to respond. In the case of server-side rendering, it is very difficult to update the portion of the page. Any portion of a page that's animated or highly interactive (such as a draggable slider, sortable table, or a drop-down menu) almost certainly uses client-side rendering.

For the last several years, the application development landscape has changed drastically because of an increase in the use of mobile devices, such as smartphones and tablets. In 2013, mobile web traffic had increased substantially to almost a third of the total web traffic; and it's expected is to increase in the near future. Applications are expected to be able to work on different platforms, such as Windows, web, and mobiles. In order to create multiplatform applications; an application should be enabled to support diverse client browsers and plugins, such as Java and Adobe Flash. The application becomes problematic if the plugins are not available or aren't supported on all devices.

Client-side application development environments enable developers to slowly and gradually replace applications, which are based on browser plugins with newer versions of HTML, CSS, and JavaScript. While previous development tools would abstract away the key elements of HTML, CSS, and JavaScript, client-side development developed all these tools. Using client-side development, a programmer can now render and manipulate content by focusing on client-browser capabilities. Several client-side application development approaches, such as responsive page design and progressive development are adopted to build modern web applications that include single-page applications. The development process of these type of applications is, however, challenging and costly when compared to other applications, because they need rapid prototyping, rich client features, and a large JavaScript base to be employed. Another JavaScript framework that has been developed in the same time frame is the AngularJS framework by Google.

There are many libraries that have been introduced, such as QUnit in 2008, Jasmine in 2010, and Backbone and Knockout.js in 2010. These libraries address challenges that involve solving client-rich features. They use derivatives involved in a design pattern, such as Model-View-Controller (MVC), which is common in both server and client-sides. During the design, application data and business logic need to be clearly differentiated. This differentiation is achievable by MVC patterns, and the controller components sit in the middle. The controller has access to all the different elements of the application, thus passing the data to and from the model, updating the view, or responding to view changes that are passed to the model. There are several advantages of using an MVC design pattern; these include reusing code in a better manner (the same model can be used for multiple views), testability (the controller can be tested from a view), and efficient development workflows that are achieved due to the designer's ability to modify the view.

AngularJS can enhance and extend HTML by adding new elements to it and it is based on the MVC pattern. It can also be tested from the start using modular, composable code units. AngularJS has only grown in popularity since its introduction in 2012.

What this book covers

Chapter 1, Introduction, acquaints you to understanding the need for client-side development and also to AngularJS. You will also get acquainted with the anatomy of AngularJS and its conceptual overview. Finally, we will discuss the basics of a single page application development process.

Chapter 2, Learning AngularJS Binding and Directives, focuses on showing you how the AngularJS data binding works. You will also learn about the use and development of AngularJS directives through code examples.

Chapter 3, AngularJS Scopes, Controllers, and Filters, the goal of this chapter is to understand AngularJS scope as well as the controller and its use in AngularJS. We will also cover the built-in filters of AngularJS and show you how to develop a custom filter.

Chapter 4, Communicating with the Server Using AngularJS, focuses on how AngularJS communicates with server-side code, such as web API, web services, or Data Access Layer (DAL). In this chapter, we will discuss how to retrieve data from the server using $http and $resources. This chapter also talks about the authentication and security used for a AngularJS application.

Chapter 5, Creating Applications Using AngularJS, Entity Framework, and ASP.NET Web API, focuses on how to connect to a database using Entity Framework. In this chapter, we will discuss how to create a web API using ASP.Net and how to consume through AngularJS.

Chapter 6, Using AngularJS and ASP.NET Web API for CRUD Operations, will start with web API routing and then focus on how to Create, Read, Update, and Delete records from a database using the ASP. Net web API and the AngularJS $http and $resource directives. We will also discuss the difference between $http and $resource. At the end of this chapter, we will talk about how to secure the ASP.Net web API.

Chapter 7, Troubleshooting and Best Practices, focuses on troubleshooting libraries and tools for AngularJS. In this chapter, we will also discuss how to perform unit testing of the Angular JS application using Jasmine and Karma. At the end of chapter, we will go through the AngularJS coding best practices.

Appendix, Angular 2.0, introduces us to the Angular 2.0 framework. It may not be a major update to the previous version, but is a complete rewrite of the entire framework and includes significant changes. Here, we also talked about certain Angular 2.0 changes. Angular 2.0 will hopefully be released at the end of 2015.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset