What this book covers
Chapter 1, JavaScript for Modern Web Applications, focuses on the basic concepts of JavaScript that involve declaration of variables, datatypes, implementing arrays, expressions, operators, and functions. We will write simple programs in JavaScript using Visual Studio 2015, and see what this IDE offers for writing JavaScript programs. We will also study how JavaScript code can be written and compare the .NET runtime with the JavaScript runtime to clarify the execution cycle of code-compilation process.
Chapter 2, Advanced JavaScript Concepts, covers the advanced concepts of JavaScript and gives developers an insight into the JavaScript language. It will show the extent to which the JavaScript language can be used as far as features are concerned. We will discuss variables hoisting and their scope, property descriptors, object-oriented programming, closures, typed arrays, and exception handling.
Chapter 3, Using jQuery in ASP.NET, discusses jQuery and how to use it in web applications developed in ASP.NET Core. We will discuss the options jQuery provides and the advantages it has when comparing it with the plain vanilla JavaScript for manipulating DOM elements, attaching events, and performing complex operations.
Chapter 4, Ajax Techniques, discusses the techniques of making asynchronous requests known as Ajax requests. We will explore the core concepts of using the XMLHttpRequest (XHR) object and study the basic architecture of how Ajax request is processed and the events and methods it provides. On the other hand, we will also explore what the jQuery library provides in comparison with the plain XHR object.
Chapter 5, Developing an ASP.NET Application Using Angular 2 and Web API, teaches the basic concepts of TypeScript and uses it with Angular 2. We will develop a simple application in ASP.NET Core using Angular 2 as a frontend client-side framework, Web API for backend services, and Entity Framework Core for database persistence. At the time of writing, Angular 2 was in a beta version, and we have used the beta version in this chapter. With the future releases of Angular 2, there are chances of having some changes in the framework, but the basic concepts will almost be the same. For future updates, you can refer to http://angular.io/.
Chapter 6, Exploring the WinJS Library, explores the Microsoft developed WinJS library, which is a JavaScript library to not only develop Windows applications using JavaScript and HTML, but also use it with ASP.NET and other web frameworks. We will discuss the core concepts of defining classes, namespaces, deriving classes, mixins, and promises. We will also look into the data-binding techniques and how to use Windows controls or specific attributes in HTML elements to change the behaviour, look, and feel of the control. Moreover, we will end up using the WinRT API to access a device's camera in our web application and discuss the concepts of a Hosted app through which any web application can be transformed into a Windows application using a Universal Window template in Visual Studio 2015.
Chapter 7, JavaScript Design Patterns, shows that design patterns provide efficient solutions to software design. We will discuss some of the industry-wide best design patterns spread into creational, structural, and behavioral categories. Each category will be covering four types of design patterns that can be used and implemented using JavaScript to solve a particular design problem.
Chapter 8, Node.js for ASP.NET Developers, focuses on the basics of Node.js and how to use it to develop server-side applications using JavaScript. In this chapter, we will discuss view engines such as EJS and Jade and the use of controllers and services to implement the MVC pattern. Moreover, we will end this chapter by performing some examples of accessing a Microsoft SQL Server database to perform, create, and retrieve operations on a database.
Chapter 9, Using JavaScript for Large-Scale Projects, provides best practices of using JavaScript for large-scale applications. We will discuss how to structure our JavaScript-based projects by splitting them into modules to increase the scalability and maintainability. We will see how effectively we can use the Mediator pattern to provide communication between modules and the documentation frameworks that increase the maintainability of your JavaScript code. Finally, we will discuss how the application can be optimized by compressing and merging JavaScript files into a minified version and increase performance.
Chapter 10, Testing and Debugging JavaScript, focuses on the testing and debugging JavaScript applications. We will discuss one of the most popular testing suites of JavaScript code known as Jasmine, and use it with Karma to run the test cases. For debugging, we will discuss some tips and techniques to debug JavaScript with Visual Studio and what Microsoft Edge offers to make debugging easy. In the end, we will study the basic concepts of how Microsoft Edge enables debugging for TypeScript files and the configuration needed to achieve it.