CoffeeScript Application Development
图书信息
| 作者 | Ian Young |
| 出版社 | Packt Publishing |
| ISBN | 9781782162674 |
| 出版时间 | 2013-08-26 |
| 字数 | 207.9万 |
| 分类 | 进口书,外文原版书,电脑,网络 |
读书简介
CoffeeScript Application Development is a practical, hands-on guide with step-by-step instructions. Follow the smooth and easy tutorial approach, covering examples that build in complexity. By the final chapter you'll be wondering why you didn't try CoffeeScript sooner.If you are a JavaScript developer who wants to save time and add power to your code, then this is the book that will help you do it. With minimal fuss you will learn a whole new language which will reduce your application development time from weeks to days.
目录
Index
Chapter 1. Running a CoffeeScript Program
Installing Node.js
Tip
Installing Node.js on OS X
Tip
Using the installer
Using Homebrew
Note
Tip
Using Macports
Tip
Installing Node.js on Windows
Using the installer
Using the standalone executable
Tip
Using Chocolatey
Tip
Installing Node.js on Linux
Using a graphical package manager
Using the command line
Tip
Linux Mint/Ubuntu 12.04 (Precise Pangolin)
Debian Sid/Ubuntu 12.10 (Quantal Quetzal)
Arch Linux
Fedora
Compiling Node.js manually
Tip
Tip
Tip
Skipping the Node installation step
Testing our Node installation
Tip
Testing npm
Tip
Installing CoffeeScript
Tip
Tip
Our very first CoffeeScript code
Compiling from a CoffeeScript file
Note
Tip
CoffeeScript support in the editor
Tip
Support in TextMate
Support in Sublime Text 2
Support in Vim
Tip
Support in Emacs
Starting our web application
Note
One more thing
Tip
Tip
Summary
Chapter 2. Writing Your First Lines of CoffeeScript
Following along with the examples
Seeing the compiled JavaScript
CoffeeScript basics
Statements
Variables
Comments
Calling functions
Precedence
Control structures
Using if statements
Tip
Note
The else and else if statements
The unless statement
Single-line form
Comparison operators
Note
Tip
Arrays
Ranges
Note
Loops
Loop comprehensions
A few more array tricks
Checking array membership
Note
Simple objects
Iterating over objects
Summary
Chapter 3. Building a Simple Application
Building our application
Tip
Tip
Tip
Note
String Interpolation
Using string interpolation in our application
Defining functions
Function naming
Note
Function return behavior
Adding dynamic behavior to our application
Tip
Tip
Tip
Switch statements
Using a switch statement in our application
Note
Summary
Chapter 4. Improving Our Application
Checking if a value exists
Using the existential operator
Null values in chained calls
Assigning new values conditionally when null
Dealing with nulls in our application
Assigning multiple values at once
Tip
Using destructuring assignment in our application
Advanced function arguments
Default argument values
Using default arguments in our application
Accepting a variable number of arguments with splats
Invoking functions with splats
Using splats in our application
Tip
Summary
Chapter 5. Classes in CoffeeScript
Defining a class in CoffeeScript
Attaching methods to a class
Note
How CoffeeScript builds classes in JavaScript
Maintaining state with object properties
Calling other methods on this object
Attaching a method outside of the class definition
Note
Constructors
CoffeeScript constructors in JavaScript
Calling methods statically on classes
Inheritance
Note
CoffeeScript's inheritance in JavaScript
Using CoffeeScript with other class libraries
Backbone classes in CoffeeScript
Note
Ember classes in CoffeeScript
Note
Summary
Chapter 6. Refactoring with Classes
The refactoring cycle
Structuring our data with classes
Note
Adding business logic
More data modeling
Note
More business logic
Managing display logic with classes
Displaying a collection
The top-level display logic
Note
A final refactoring pass
Using inheritance while refactoring
Getting the green light
Summary
Chapter 7. Advanced CoffeeScript Usage
Getting our context right
Note
Note
Using fat arrows in our project
Saving our work with memoization
Tip
Using memoization in our application
A new idiom: options objects
Tip
Note
Using options objects in our application
Tip
Summary
Chapter 8. Going Asynchronous
Understanding asynchronous operations
Getting to know our remote API
Note
Making an asynchronous request
Note
Using a third-party library
Note
Refactoring
Wrangling multiple asynchronous calls
Requests in a loop
Note
Determining when we're finished
Alternatives for managing asynchronous calls
Promises
Note
Using Promises in our application
Note
An async helper library
Note
Using Async.js in our application
IcedCoffeeScript
Note
Note
Using IcedCoffeeScript in our application
Tip
Summary
Chapter 9. Debugging
Discovering a problem
Working with source maps
Note
Source maps in the Firefox developer tools
Tip
Inspecting our application state
Tip
Using the debugger
Source maps in the Chrome developer tools
Inspecting our application state
Using the debugger
Fixing the problem
Summary
Chapter 10. Using CoffeeScript in More Places
CoffeeScript directly in the browser
Note
CoffeeScript in the browser console
A CoffeeScript console in Firefox
Tip
Tip
Tip
A CoffeeScript console in Chrome
Using CoffeeScript with Rails
Setting up the asset pipeline
Creating a new Rails application
Tip
Rails 3.0
Rails 3.1 and 3.2
Tip
Rails 4
Setting up our application
Adding some CoffeeScript
Tip
Note
Precompiling assets
Tip
Using CoffeeScript with Brunch
Creating a Brunch project
Tip
Note
Tip
Filling out our application
Tip
Tip
Precompiling assets
Using CoffeeScript with Node.js
Creating our project
Keeping the server up-to-date
Note
Adding CoffeeScript compilation
Note
Finishing our application
Tip
Cleaning up our script dependencies
Summary
Chapter 11. CoffeeScript on the Server
Running a server with CoffeeScript
Tip
Note
Tip
Running our application
Adding an endpoint for data
Using a database
Tip
Tip
Handling errors
Using a Cakefile
Writing a Cake task
More Cake tasks
Making our application interactive
Seeing the results
Summary
CoffeeScript Application Development
CoffeeScript Application Development
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What is CoffeeScript?
Why CoffeeScript?
Note
What this book covers
What you need for this book
Who this book is for
Conventions
Note
Tip
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
Table of Contents
- 医疗美容法律法规与风险管理(美容医学系列数字化创新教材)(曹伟,石悦)
- 催化裂化装置设备维护检修案例(胡安定)
- 床头灯英语・5000词读物(英汉对照):罗马故事((希腊)普卢塔克)
- 梅花易数((宋)邵雍撰)
- 管理的中国心(何志毅)
- 财务管理学习指导、习题与项目实训 专著 陈昌才,朱文峰,袁萍主编 cai wu(陈昌才,朱文峰,袁萍)
- 绘・童年:梦幻柏树街 (精装绘本)(著名儿童文学作家“阳光姐姐”伍美珍绘本处女作)(伍美珍)
- 刑法评论-2016年 第1卷[总第29卷](赵秉志)
