logo资料库

Front-end Development with ASP.NET Core, Angular, and Bootstrap(....pdf

第1页 / 共281页
第2页 / 共281页
第3页 / 共281页
第4页 / 共281页
第5页 / 共281页
第6页 / 共281页
第7页 / 共281页
第8页 / 共281页
资料共281页,剩余部分请下载后查看
Cover
Title Page
Copyright
About the Author
About the Technical Editor
Credits
Acknowledgments
Contents
Foreword
Introduction
Why Web Development Requires Polyglot Developers
The Right Tool for the Job
Cross Pollination
Growing Your Comfort Zone
Who This Book is for
What This Book Covers
How This Book is Structured
What you Need to use This Book
Conventions
Source Code
Errata
Chapter 1: What’s New in ASP.NET Core MVC
Getting the Names Right
ASP.NET Core
.NET Core
Visual Studio Code
Visual Studio 2017
Versions Covered in this Book
A Brief History of the Microsoft .NET Web Stack
ASP.NET Web Forms
ASP.NET MVC
ASP.NET Web API
OWIN and Katana
The Emergence of ASP.NET Core and .NET Core
.NET Core
Getting Started with .NET Core
The dotnet Command Line
Introducing ASP.NET Core
Overview of the New ASP.NET Core Web Application Project
Owin
OWIN Layers
OWIN Communication Interface
A Better Look at Middleware
Anatomy of an ASP.NET Core Application
Host Builder Console Application
ASP.NET Core Startup Class
New Fundamental Features of ASP.NET Core
Environments
Dependency Injection
What Is Dependency Injection?
Using Dependency Injection in ASP.NET Core
Logging
Logger Instantiation
Writing Log Messages
Additional Logging Configuration
Configuration
Setting Up the Configuration Sources
Reading Values from Configuration
Using Strongly-Typed Configuration
An Overview of Some ASP.NET Core Middleware
Diagnostics
Serving Static Files
Application Frameworks
ASP.NET Core MVC
Using the MVC Framework inside ASP.NET Core
Using Dependency Injection in Controllers
View Components
Tag Helpers
Using Tag Helpers from ASP.NET Core
Writing Custom Tag Helpers
View Components as Tag Helpers
Web API
Summary
Chapter 2: The Front-End Developer Toolset
Additional Languages You Have to Know
Node.js
JSON
Sass and Less
The Future of JavaScript
TypeScript
JavaScript Frameworks
Angular
Knockout
React
jQuery
CSS Frameworks
Bootstrap
Primer CSS
Material Design Lite
Semantic UI
Package Managers
NuGet
Bower
NPM
The Folder Structure
Task Runners
Summary
Chapter 3: Angular in a Nutshell
Angular Concepts
The Language of Angular
Setting Up an Angular Project
Using an Online Editor
Starting from the Quickstart Seed
Using the Angular-CLI Tool
The Structure of an Angular App
Application Entry Point
Root Module
Root Component
Main HTML Page
Data Binding
Interpolation
One-Way Binding
Event binding
Two-Way Binding
Directives
Services and Dependecy Injection
Multiple Components
Input and Output Properties
Talking to the Back End
Using the Http Module
Consuming the RxJS Observable
Subscribing to the Observable
Using the async Pipe
Using Promises
Using Angular with ASP.NET MVC
Combining Angular and ASP.NET Core Projects
Keeping Angular and ASP.NET Core as Two Separate projects
Combining Angular and ASP.NET Core into One Project Using the Angular CLI
Using JavaScriptServices
Deciding Which Integration Method to Use
Visual Studio 2017 Support for Angular
Code Snippets
IntelliSense in TypeScript Files
IntelliSense in HTML Files
Summary
Chapter 4: Bootstrap in a Nutshell
Introduction to Bootstrap
Installing Bootstrap
The Main Features
Bootstrap Styles
Grid System
Typography
Tables
Forms
Buttons
Components
Glyphicons
Dropdown
Input Groups
Navigation
Navigation Bar
Pagination
Breadcrumbs
Tabs and Pills
Other Components
JavaScript
Tabbed Content
Activating Tab Navigation with JavaScript
Activating Tab Navigation with Data Attributes
Modal Dialog
Tooltips and Popovers
Customizing Bootstrap with Less
Customizing via the Website
Customizing with LESS
Bootstrap Support in Visual Studio 2017 and ASP.NET Core
Bootstrap Snippet Pack
Glyphfriend
Tag Helpers for ASP.NET Core
Summary
Chapter 5: Managing Dependencies with NuGet and Bower
General Concepts
NuGet
Getting Packages via NuGet
Using the Package Manager GUI
Using the Package Manager Console
Manually Editing the .csproj Project File
What Happens Once You Install a Package
Publishing Your Own Packages
Adding Metadata for the Package
Creating the Package
Publishing to the Nuget.org Gallery
NPM (Node.js Package Manager)
Installing NPM
NPM Usage
Using the NPM Command Line
Using NPM within Visual Studio
Where Packages Are Installed
Bower
Installing Bower
Getting Packages with Bower
Using the Bower Command Line
Using the Bower Package Manager GUI in Visual Studio
Editing the bower.json File
Where Packages Are Installed
Creating Your Own Packages
Summary
Chapter 6: Building Your Application with Gulp and webpack
What Front-End Build Systems Are For
A Deeper Look at Gulp
Getting Started with Gulp
The Gulpfile.js File
gulp.task()
gulp.watch()
gulp.src()
gulp.dest()
A Typical Gulp Build File
More Gulp Recipes
Naming Output Files from a Package Name
Generating Source maps
Checking JavaScript Using JSHint
Executing Tasks When Files Change
Managing Bower Dependencies
Replacing References Directly in the HTML Files
Introduction to webpack
webpack’s Main Concepts
Using webpack
Bundling JavaScript
Bundling Stylesheets
Minifying and Adding Sourcemaps
More Things webpack Can Do
Visual Studio 2017 and Build Systems
The Bundler and Minifier Extension
The Task Runner Explorer
IntelliSense for Gulp
Summary
Chapter 7: Deploying ASP.NET Core
The New Hosting Model of ASP.NET Core
Installing on Internet Information Services On Premise
Making Sure All Is Well
Installing AspNetCoreModule
Publishing Applications via the Command Line
Creating the Website
Publishing the Applications via Visual Studio
Deploying on Azure
Deploying to Azure from Visual Studio with Web Deploy
Continuous Deployment to Azure with Git
Configuring the Azure Web App
Configuring the Local Repository
Deploying to Docker Containers
Installing the Docker Support
Publishing a Docker Image
Summary
Chapter 8: Developing Outside of Windows
Installing .NET Core on macOS
Building the First ASP.NET Core App on macOS
Using dotnet Command-Line Interface
Using Yeoman
Visual Studio Code
Setting It Up
Development Features in Visual Studio Code
IntelliSense
Refactoring
Errors and Suggestions
Debugging
Version Control
Tasks
Other Features
OmniSharp
Other IDEs
Using Command-line Tools
Summary
Chapter 9: Putting It All Together
Building a Triathlon Race Results Web Site
Building the Back-Office Site
Setting Up Entity Framework
The Object Model
The EF Core Context
Migrations
Building CRUD Screens
The Controller
The View
Building the Registration Page
Showing Real-Time Results
Creating the Angular Client-Side Application
Building the Web APIs
Connecting with IoT Devices
Deploying
Summary
Index
EULA
www.allitebooks.com
FRONT-END DEVELOPMENT WITH ASP.NET CORE, ANGULAR, AND BOOTSTRAP FOREWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii CHAPTER 2 CHAPTER 1 What’s New in ASP.NET Core MVC . . . . . . . . . . . . . . . . . . . . . . . . . . 1 The Front-End Developer Toolset . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 CHAPTER 3 Angular in a Nutshell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 CHAPTER 4 Bootstrap in a Nutshell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 CHAPTER 5 Managing Dependencies with NuGet and Bower . . . . . . . . . . . . . 129 CHAPTER 6 Building Your Application with Gulp and webpack . . . . . . . . . . . . 145 CHAPTER 7 Deploying ASP.NET Core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 CHAPTER 8 Developing Outside of Windows . . . . . . . . . . . . . . . . . . . . . . . . . . 189 Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 CHAPTER 9 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
www.allitebooks.com
Front-end Development with ASP.NET Core, Angular, and Bootstrap www.allitebooks.com
www.allitebooks.com
Front-end Development with ASP.NET Core, Angular, and Bootstrap Simone Chiaretta
Front-end Development with ASP.NET Core, Angular, and Bootstrap Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2018 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-119-18131-6 ISBN: 978-1-119-24396-0 (ebk) ISBN: 978-1-119-18140-8 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748- 6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or pro- motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the pub- lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with stan- dard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http:// booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Control Number: 2018930062 Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trade- marks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.
For Signe, for the support over the project
分享到:
收藏