- Ember.js Cookbook
- Erik Hanchett
- 1305字
- 2021-07-16 12:57:59
Preface
Single-page, client-side JavaScript frameworks may possibly be the future of the Web. Client-side frameworks have matured a lot in the last few years. They've made creating web applications easier and more responsive. Ember.js has been one of the leading frameworks behind this movement.
This book provides in-depth explanations of how to use the Ember.js framework to take you from being a beginner to an expert. You'll start with the basics, and by the end of the book, you'll have a solid foundation in creating real-time web applications in Ember.
We'll begin by explaining key points on how to use the Ember.js framework and associated tools. You'll learn how to use Ember CLI effectively and how to create and deploy your application. We'll take a close look at the Ember object model and templates by looking at bindings and observers. We'll move on to Ember components and models and Ember Data. Next, we'll look at testing with integration and acceptance tests using QUnit. Afterward, we'll take a look at authentication and services and working with Ember add-ons. We'll explore advanced topics such as services and initializers and how to use them together to build real-time applications.
What this book covers
Chapter 1, Ember CLI Basics, shows you how to use the Ember CLI command-line tool and deal with upgrading and deploying your project.
Chapter 2, The Ember.Object Model, demonstrates how to create Ember objects and instances and use bindings, mixins, and enumerables.
Chapter 3, Ember Templates, tells you how to use templates and template helpers.
Chapter 4, Ember Router, demonstrates how to set up your model and work with loading states and redirection.
Chapter 5, Ember Controllers, explains how to use properties and manage dependencies between controllers.
Chapter 6, Ember Components, covers passing properties, events, and actions.
Chapter 7, Ember Models and Ember Data, explains how to manipulate records and customize adapters.
Chapter 8, Logging, Debugging, and Testing, demonstrates how to create acceptance and unit tests as well as the Ember Inspector.
Chapter 9, Real-Life Tasks with Ember.js, discusses how to use services, authentication, Bootstrap, and Liquid Fire.
Chapter 10, Awesome Tasks with Ember, explains how to use Ember validations, Firebase, WebSockets, and server-side rendering.
Chapter 11, Real-Time Web Applications, discusses how to use dependency injection, application initializers, run loops, and create add-ons.
What you need for this book
- Windows, Mac OS X, or Linux
- NPM 2.x or greater
- Node 4.0 or higher, freely obtained from http://www.nodejs.org
- Bower 1.4 or greater
Who this book is for
Anyone who wants to explore Ember.js and wishes to get hands-on experience making sophisticated web apps with less coding will find this book handy. Prior experience of coding and familiarity with JavaScript is recommended. If you've heard of Ember.js or are just curious on how a single-page application framework works, then this book is for you.
Sections
In this book, you will find several headings that appear frequently (Getting ready, How to do it..., How it works..., There's more..., and See also).
To give clear instructions on how to complete a recipe, we use these sections as follows:
Getting ready
This section tells you what to expect in the recipe, and describes how to set up any software or any preliminary settings required for the recipe.
How to do it…
This section contains the steps required to follow the recipe.
How it works…
This section usually consists of a detailed explanation of what happened in the previous section.
There's more…
This section consists of additional information about the recipe in order to make the reader more knowledgeable about the recipe.
See also
This section provides helpful links to other useful information for the recipe.
Conventions
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts through the use of the include
directive."
A block of code is set as follows:
{ "usePods": true }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
const Light = Ember.Object.extend({
isOn: false,
color: 'yellow',
age: null,
description: Ember.computed('isOn','color',function() {
return 'The ' + this.get('color') + ' light is set to ' + this.get('isOn');
}),
fullDescription: Ember.computed('description','age',function() {
return this.get('description') + ' and the age is ' + this.get('age')
}),
aliasDescription: Ember.computed.alias('fullDescription')
});
const bulb = Light.create({age: 22});
bulb.get('aliasDescription');//The yellow light is set to false and the age is 22.
Any command-line input or output is written as follows:
$ ember server --port 1234
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "The message on the screen will show Hello World! My name is John Smith. Hello World! My name is Erik Hanchett."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <feedback@packtpub.com>
, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code
You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. 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.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <copyright@packtpub.com>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
Questions
If you have a problem with any aspect of this book, you can contact us at <questions@packtpub.com>
, and we will do our best to address the problem.
- HTML5+CSS3王者歸來
- 微服務(wù)設(shè)計(jì)(第2版)
- jQuery Mobile Web Development Essentials(Third Edition)
- Java程序設(shè)計(jì)與開發(fā)
- iOS面試一戰(zhàn)到底
- Java程序設(shè)計(jì)(慕課版)
- ASP.NET MVC4框架揭秘
- UML+OOPC嵌入式C語言開發(fā)精講
- Unity Shader入門精要
- PostgreSQL Replication(Second Edition)
- 軟件測(cè)試技術(shù)指南
- Salesforce Reporting and Dashboards
- C語言從入門到精通
- Apache Camel Developer's Cookbook
- Getting Started with React VR