O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering AngularJS for .NET Developers

Book Description

Master the art of developing applications using AngularJS, ASP.NET Web API 2, and Visual Studio 2013

In Detail

AngularJS is an open source framework that utilizes the Model-View-Controller architecture for client-side application development. AngularJS is referred to as the Angular framework.

With this book, you will soon be able to build client-side data driven applications. The introduction section covers the essentials of AngularJS, covering the core concepts of AngularJS to ensure a smooth transition to the more advanced topics discussed later on.

This book covers the development of client-side applications with AngularJS using code examples before moving on to explore how to build the ASP.NET Web API and its features using Visual Studio .NET.

What You Will Learn

  • Understand the architecture of AngularJS
  • Discover the uses and working of data binding in AngularJS
  • Learn the scope of AngularJS with a thorough understanding of the controller and the filter
  • Master the use of $http and $resources to communicate with the server in order to retrieve and post data
  • Integrate an AngularJS application with Entity Framework and ASP.NET Web API 2 while learning about the use of JSON objects
  • in AngularJS
  • Walk through the development environment using the AngularJS NuGet packages
  • Learn about troubleshooting and debugging options in an AngularJS application by using different libraries and tools
  • Discover the uses of Visual Studio 2013 to build CRUD operations using ASP.NET Web API 2 and AngularJS
  • Authenticate and understand security mechanisms for AngularJS applications

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Mastering AngularJS for .NET Developers
    1. Table of Contents
    2. Mastering AngularJS for .NET Developers
    3. Credits
    4. About the Authors
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Introduction
      1. Understanding the need for client-side development
        1. Client-side data binding libraries
      2. Understanding AngularJS
        1. What is AngularJS?
        2. Why AngularJS?
      3. Getting acquainted with the anatomy of AngularJS
        1. Model
        2. View
        3. Controller
        4. The AngularJS design pattern
        5. Notable built-in directives
      4. AngularJS – the conceptual overview
        1. Templates
        2. Directives
        3. Filters
        4. Services
        5. Dependency Injection
        6. The compiler
      5. The overview of a single-page application
        1. Benefits of SPAs
      6. Summary
    9. 2. Learning AngularJS Binding and Directives
      1. Data binding
        1. One-way binding
        2. Two-way binding
        3. Data binding in AngularJS
          1. One-way data binding in AngularJS
          2. Two-way data binding in AngularJS
      2. Understanding directives
      3. The first directive
      4. The jQuery perspective
        1. Basic behavior
          1. The restrict property
          2. The template and templateUrl properties
          3. The scope property
            1. The @ local scope property
            2. The = local scope property
            3. The & local scope property
            4. Transclusion
      5. Directive-to-directive communication
      6. Summary
    10. 3. AngularJS Scopes, Controllers, and Filters
      1. Understanding the scope of AngularJS
        1. AngularJS scope's chain of command
        2. The AngularJS scope lifecycle
        3. Adding behavior to the AngularJS scope
      2. Understanding controllers
        1. Controller inheritance
          1. The AngularJS dot representation
        2. Controller without scope
      3. Understanding filters
        1. The custom filter
      4. Using a filter in a controller
      5. Summary
    11. 4. Communicating with the Server Using AngularJS
      1. Communicating with the server using $http
        1. Retrieving data with $http using GET
          1. Configuring the $http request
          2. Caching $http
          3. Transforming request and response
      2. Communicating with the server using RESTful services and $resource
      3. Authentication
        1. Authentication with username and password
      4. Securing applications
      5. Summary
    12. 5. Creating Applications Using AngularJS, Entity Framework, and ASP.NET Web API
      1. Using Entity Framework
        1. Entity Data Model
          1. Mapping
          2. Entities
          3. Relationships
          4. Querying data
        2. Creating a data model from an existing database
      2. A web API
        1. Why a web API?
        2. Different API types
          1. Web service APIs
          2. Library-based APIs
          3. Class-based APIs
          4. Object-remoting APIs
          5. Hardware APIs
        3. Creating a web API using Visual Studio
          1. LINQ
      3. Using AngularJS with ASP.NET Web API
      4. Summary
    13. 6. Using AngularJS and ASP.NET Web API for CRUD Operations
      1. Web API routing
        1. Routing with an action name
        2. The ASP.NET Web API attribute routing
      2. CRUD operation using $http
        1. Using $http with the AngularJS factory
      3. CRUD operations using $resource
      4. The difference between $http and $resource
      5. Securing the ASP.NET Web API
      6. Summary
    14. 7. Troubleshooting and Best Practices
      1. Troubleshooting libraries and tools
        1. Unit testing
        2. What and what not to test
        3. Unit testing using AngularJS
          1. Module
          2. Controller
          3. Directive
      2. Unit testing using Jasmine
      3. Unit testing using Karma
      4. AngularJS coding best practices
        1. Organizing code
          1. Piles
          2. Drawer
          3. Modularity
          4. Common code
        2. Using AngularJS
      5. Summary
    15. A. Angular 2.0
      1. Why Angular 2.0
      2. Design and features of AngularJS 2.0
        1. AtScript
        2. Routing solution
        3. Dependency Injection
          1. Annotations
          2. The instance scope
          3. The child injector
        4. Data binding and templating
          1. Dynamic loading
          2. Directives
          3. Templates
      3. Summary
    16. Index