You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/v1.10.0/getting-started/planning-the-application.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
TodoMVC, despite its small size, contains most of the behaviors typical in modern single page applications. Before continuing, take a moment to understand how TodoMVC works from the user's perspective.
2
2
3
3
TodoMVC has the following main features:
4
-
<imgsrc="../images/todo-mvc.png"width="680">
4
+
<imgsrc="/images/todo-mvc.png"width="680">
5
5
6
6
1. It displays a list of todos for a user to see. This list will grow and shrink as the user adds and removes todos.
Copy file name to clipboardExpand all lines: guides/v1.10.0/models/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,7 @@ adapter. Your adapter will go and retrieve the record from your
209
209
persistence layer; typically, this will be a JSON representation of the
210
210
record served from an HTTP server.
211
211
212
-

212
+

213
213
214
214
As illustrated in the diagram above, the adapter cannot always return the
215
215
requested record immediately. In this case, the adapter must make an
@@ -228,12 +228,12 @@ The store then takes that JSON, initializes the record with the
228
228
JSON data, and resolves the promise returned to your application
229
229
with the newly-loaded record.
230
230
231
-

231
+

232
232
233
233
Let's look at what happens if you request a record that the store
234
234
already has in its cache.
235
235
236
-

236
+

237
237
238
238
In this case, because the store already knew about the record, it
239
239
returns a promise that it resolves with the record immediately. It does
This system works well at first glance, but imagine that we want to open Joe's Lamprey Shack at 8am instead of 9am. In this situation, we will want to re-render the App View. Because the developer needed to build up the references to the children on an ad-hoc basis, this re-rendering process has several problems.
@@ -31,7 +31,7 @@ In order to re-render the App View, the App View must also manually re-render th
31
31
In order to avoid these problems, Ember's view hierarchy has the concept of child views baked in.
When the App View re-renders, Ember is responsible for re-rendering and inserting the child views, not application code. This also means that Ember can perform any memory management for you, such as cleaning up observers and bindings.
@@ -45,13 +45,13 @@ In the past, web developers have added event listeners to individual elements in
45
45
However, this approach often does not scale when dealing with large numbers of interactive elements. For example, imagine a `<ul>` with 100 `<li>`s in it, with a delete button next to each item. Since the behavior is the same for all of these items, it would be inefficient to create 100 event listeners, one for each delete button.
To solve this problem, developers discovered a technique called "event delegation". Instead of registering a listener on each element in question, you can register a single listener for the containing element and use `event.target` to identify which element the user clicked on.
52
52
53
53
<figure>
54
-
<imgsrc="../../images/view-guide/delegated.png">
54
+
<imgsrc="/images/view-guide/delegated.png">
55
55
</figure>
56
56
57
57
Implementing this is a bit tricky, because some events (like `focus`, `blur` and `change`) don't bubble. Fortunately, jQuery has solved this problem thoroughly; using jQuery's `on` method reliably works for all native browser events.
@@ -75,7 +75,7 @@ While the process of displaying a template is automatic for developers, under th
75
75
This is the approximate lifecycle of an Ember view:
In addition to children (Strings and other `RenderBuffer`s), a `RenderBuffer` also encapsulates the element's tag name, id, classes, style, and other attributes. This makes it possible for the render process to modify one of these properties (style, for example), even after its child Strings have rendered. Because many of these properties are controlled via bindings (e.g. using `bind-attr`), this makes the process robust and transparent.
@@ -130,7 +130,7 @@ In addition to these cases, the application may sometimes want to explicitly re-
130
130
The process looks something like:
131
131
132
132
<figure>
133
-
<imgsrc="../../images/view-guide/re-render.png">
133
+
<imgsrc="/images/view-guide/re-render.png">
134
134
</figure>
135
135
136
136
### The View Hierarchy
@@ -156,7 +156,7 @@ var view = Ember.View.create({
156
156
This will create a small view hierarchy that looks like this:
Copy file name to clipboardExpand all lines: guides/v1.11.0/models/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -206,7 +206,7 @@ adapter. Your adapter will go and retrieve the record from your
206
206
persistence layer; typically, this will be a JSON representation of the
207
207
record served from an HTTP server.
208
208
209
-

209
+

210
210
211
211
As illustrated in the diagram above, the adapter cannot always return the
212
212
requested record immediately. In this case, the adapter must make an
@@ -225,12 +225,12 @@ The store then takes that JSON, initializes the record with the
225
225
JSON data, and resolves the promise returned to your application
226
226
with the newly-loaded record.
227
227
228
-

228
+

229
229
230
230
Let's look at what happens if you request a record that the store
231
231
already has in its cache.
232
232
233
-

233
+

234
234
235
235
In this case, because the store already knew about the record, it
236
236
returns a promise that it resolves with the record immediately. It does
0 commit comments