From aa3481ab0ed021852e720377c411a298d4eef1fb Mon Sep 17 00:00:00 2001 From: Tower He Date: Tue, 11 Feb 2014 23:17:56 +0800 Subject: [PATCH] Keep it up-to-date --- data/guides.yml | 4 +- lib/toc.rb | 6 +- .../concepts/naming-conventions.md | 4 +- .../creating_reusable_social_share_buttons.md | 2 +- .../continuous_redrawing_of_views.md | 23 +- .../bilingual_guides/getting-ember/index.md | 2 +- .../getting-started/accepting-edits.md | 4 +- .../adding-a-route-and-template.md | 1 + .../getting-started/adding-child-routes.md | 28 ++- .../getting-started/deleting-todos.md | 4 +- ...play-a-button-to-remove-completed-todos.md | 7 +- ...splaying-the-number-of-incomplete-todos.md | 9 +- .../obtaining-emberjs-and-dependencies.md | 4 +- .../show-only-complete-todos.md | 4 +- .../show-only-incomplete-todos.md | 4 +- .../getting-started/using-other-adapters.md | 4 +- .../models/handling-metadata.md | 2 +- .../models/persisting-records.md | 16 +- .../models/the-rest-adapter.md | 4 +- .../object-model/classes-and-instances.md | 26 +-- .../routing/loading-and-error-substates.md | 19 +- .../bilingual_guides/routing/query-params.md | 2 +- .../understanding-ember/run-loop.md | 212 ++++++++++++++++++ .../views/manually-managing-view-hierarchy.md | 4 +- .../2014-02-07-ember-security-releases.md | 48 ++++ source/guides/concepts/naming-conventions.md | 2 +- .../adding_google_analytics_tracking.md | 56 +++++ .../creating_reusable_social_share_buttons.md | 2 +- .../continuous_redrawing_of_views.md | 14 +- .../guides/getting-started/accepting-edits.md | 2 +- .../adding-a-route-and-template.md | 1 + .../getting-started/adding-child-routes.md | 24 +- .../guides/getting-started/deleting-todos.md | 1 + ...play-a-button-to-remove-completed-todos.md | 5 +- ...splaying-the-number-of-incomplete-todos.md | 4 +- .../obtaining-emberjs-and-dependencies.md | 4 +- .../show-only-complete-todos.md | 4 +- .../show-only-incomplete-todos.md | 4 +- source/guides/models/handling-metadata.md | 2 +- source/guides/models/persisting-records.md | 16 +- source/guides/models/the-rest-adapter.md | 4 +- .../object-model/classes-and-instances.md | 20 +- .../routing/loading-and-error-substates.md | 17 +- source/guides/understanding-ember/run-loop.md | 212 ++++++++++++++++++ .../views/manually-managing-view-hierarchy.md | 4 +- source/javascripts/app/builds/app.js | 26 ++- source/stylesheets/site.css.scss | 2 +- spec/toc_spec.rb | 2 +- 48 files changed, 713 insertions(+), 158 deletions(-) create mode 100644 source/bilingual_guides/understanding-ember/run-loop.md create mode 100644 source/blog/2014-02-07-ember-security-releases.md create mode 100644 source/guides/cookbook/helpers_and_components/adding_google_analytics_tracking.md create mode 100644 source/guides/understanding-ember/run-loop.md diff --git a/data/guides.yml b/data/guides.yml index 8cfa7d5..b9a54d4 100644 --- a/data/guides.yml +++ b/data/guides.yml @@ -1,4 +1,4 @@ -"Ember.js 指南": +"指南与教程": - title: 'Ember.js 指南' url: 'index.html' skip_sidebar: true @@ -359,6 +359,8 @@ Cookbook: url: "understanding-ember/keeping-templates-up-to-date" - title: "调试" url: "understanding-ember/debugging" + - title: "The Run Loop" + url: "understanding-ember/run-loop" #Contributing to Ember.js: #- title: "Adding New Features" #url: "contributing/adding-new-features" diff --git a/lib/toc.rb b/lib/toc.rb index bf86a4f..06f8ca3 100644 --- a/lib/toc.rb +++ b/lib/toc.rb @@ -100,10 +100,10 @@ def guide_slug def chapter_github_source_url base_guide_url = "https://github.com/emberjs-cn/www.emberjs.cn/tree/master/source/guides" - if current_guide - return "#{base_guide_url}/#{current_guide['url']}.md" + if section_slug == guide_slug + return "#{base_guide_url}/#{current_guide['url']}/index.md" else - return "#{base_guide_url}/index.md" + return "#{base_guide_url}/#{current_guide['url']}.md" end end diff --git a/source/bilingual_guides/concepts/naming-conventions.md b/source/bilingual_guides/concepts/naming-conventions.md index f790b2f..05dd280 100644 --- a/source/bilingual_guides/concepts/naming-conventions.md +++ b/source/bilingual_guides/concepts/naming-conventions.md @@ -9,9 +9,9 @@ for your routes, controllers and templates. `Ember.js`使用命名惯例来连接各个对象,而不是通过大量的引用。对于路由,控制器以及模板,你都应该使用此命名惯例。 -You can usually guess the names, but this guide outlines, in one place, all of the naming conventions. In the following examples 'App' is a name that we chose to namespace or represent our Ember application when it was created, but you can theoretically choose any name you want for your application. We will show you later how to create an Ember application, but for now we will focus on conventions. +You can usually guess the names, but this guide outlines, in one place, all of the naming conventions. In the following examples 'App' is a name that we chose to namespace or represent our Ember application when it was created, but you can choose any name you want for your application. We will show you later how to create an Ember application, but for now we will focus on conventions. -有些时候,或许你可以猜到某些正确的命名,但是,这篇指南在此概述了所有的命名惯例。在下面的例子中'App'是被选来作为命名空间的名字,或者说用来代表Ember应用,当然理论上可以选择任何你喜欢的名字。后面我们将具体介绍如何创建一个Ember应用,不过现在我们将关注惯例。 +有些时候,或许你可以猜到某些正确的命名,但是,这篇指南在此概述了所有的命名惯例。在下面的例子中'App'是被选来作为命名空间的名字,或者说用来代表Ember应用,当然也可以选择任何你喜欢的名字。后面我们将具体介绍如何创建一个Ember应用,不过现在我们将关注惯例。 ## 应用程序(The Application) diff --git a/source/bilingual_guides/cookbook/helpers_and_components/creating_reusable_social_share_buttons.md b/source/bilingual_guides/cookbook/helpers_and_components/creating_reusable_social_share_buttons.md index 4553f43..b871ec8 100644 --- a/source/bilingual_guides/cookbook/helpers_and_components/creating_reusable_social_share_buttons.md +++ b/source/bilingual_guides/cookbook/helpers_and_components/creating_reusable_social_share_buttons.md @@ -74,4 +74,4 @@ Note: Your component must have a matching template named `share-twitter`. Becaus #### 示例 -JS Bin +JS Bin diff --git a/source/bilingual_guides/cookbook/working_with_objects/continuous_redrawing_of_views.md b/source/bilingual_guides/cookbook/working_with_objects/continuous_redrawing_of_views.md index 4928a24..2dc0482 100644 --- a/source/bilingual_guides/cookbook/working_with_objects/continuous_redrawing_of_views.md +++ b/source/bilingual_guides/cookbook/working_with_objects/continuous_redrawing_of_views.md @@ -26,9 +26,9 @@ generated within the application, like a list of comments. ## 讨论 -Cookbook: Continuous Redrawing of Views +Cookbook: Continuous Redrawing of Views -Cookbook: 持续重绘视图 +Cookbook: 持续重绘视图 ### ClockService object @@ -115,27 +115,26 @@ App.IntervalController = Ember.ObjectController.extend({ }); ``` -A controller for a list of comments, which creates a new clock instance -for each comment. Each comment in the list also has a controller. When a -comment is created the `init` method adds a clock instance to the comment. +A controller for a list of comments, each comment will have a new clock +instance when added to the list. The comment item controller sets up +the `seconds` binding, used by the template to show the time since the +comment was created. -一个评论列表的控制器,为每条评论创建一个时钟实例。列表中的每条评论都有一个控制器。当一条评论被创建时,`init`方法添加一个时钟实例到评论。 +一个评论列表的控制器,每条评论在被添加到列表时,会得到一个新的时钟实例。评论条目控制器设置`seconds`绑定,用于在模板中显示评论创建了多长时间。 ```javascript App.CommentItemController = Ember.ObjectController.extend({ - init: function() { - this.set('clock', ClockService.create()); - } + seconds: Ember.computed.oneWay('clock.pulse').readOnly() }) App.CommentsController = Ember.ArrayController.extend({ needs: ['interval'], - clockBinding: 'controllers.interval.clock', itemController: 'commentItem', actions: { add: function () { this.addObject(Em.Object.create({ - comment: $('#comment').val() + comment: $('#comment').val(), + clock: ClockService.create() })); } } @@ -229,7 +228,7 @@ The source code: 源代码: -* +* Further reading: diff --git a/source/bilingual_guides/getting-ember/index.md b/source/bilingual_guides/getting-ember/index.md index 4b79b75..baaba54 100644 --- a/source/bilingual_guides/getting-ember/index.md +++ b/source/bilingual_guides/getting-ember/index.md @@ -10,7 +10,7 @@ Ember的发布管理团队针对Ember和Ember Data维护了不同的发布方法 ### 频道 -The latest [Release](/builds#/release), [Beta](/builds#/beta), and [Canary](/builds#/canary) builds of Ember and Ember data can be found [here](/builds). For each channel a development, minified, and production version is available. For more on the differnt channels read the [Post 1.0 Release Cycle](http://emberjs.com/blog/2013/09/06/new-ember-release-process.html) blog post. +The latest [Release](/builds#/release), [Beta](/builds#/beta), and [Canary](/builds#/canary) builds of Ember and Ember data can be found [here](/builds). For each channel a development, minified, and production version is available. For more on the different channels read the [Post 1.0 Release Cycle](http://emberjs.com/blog/2013/09/06/new-ember-release-process.html) blog post. 最新的Ember和Ember Data的[Release](/builds#/release),[Beta](/builds#/beta)和[Canary](/builds#/canary)构建可以在[这里](/builds)找到。每一个频道都提供了一个开发版、最小化版和生产版。更多关于不同频道的信息可以查看博客[1.0后发布周期](http://emberjs.com/blog/2013/09/06/new-ember-release-process.html)。 diff --git a/source/bilingual_guides/getting-started/accepting-edits.md b/source/bilingual_guides/getting-started/accepting-edits.md index 79f8fbd..b2bfbbd 100644 --- a/source/bilingual_guides/getting-started/accepting-edits.md +++ b/source/bilingual_guides/getting-started/accepting-edits.md @@ -52,7 +52,7 @@ In `index.html` replace the static `` element with our custom `{{edit-tod {{#if isEditing}} - {{edit-todo class="edit" value=title focus-out="acceptChanges" + {{edit-todo class="edit" value=title focus-out="acceptChanges" insert-newline="acceptChanges"}} {{else}} @@ -63,7 +63,7 @@ Pressing the `` key will trigger the `acceptChanges` event on the instan 点击``键会触发`TodoController`实例的`acceptChanges`事件。焦点离开``时会出发`focus-out`事件,并调用视图的`TodoController`实例的`acceptChanges`方法。 -Additionally, we connect the `value` property of this `` to the `title` property of this instance of `TodoController`. We will not implement a `title` property on the controller so it will retain the default behavior of proxying all requests to its `model`. +Additionally, we connect the `value` property of this `` to the `title` property of this instance of `TodoController`. We will not implement a `title` property on the controller so it will retain the default behavior of proxying all requests to its `model`. 此外,`TodoController`实例的`title`属性与``的`value`属性进行了绑定。控制器中并没有定义`title`属性,这样控制就保持默认的行为,将所有请求代理到其`model`之上。 diff --git a/source/bilingual_guides/getting-started/adding-a-route-and-template.md b/source/bilingual_guides/getting-started/adding-a-route-and-template.md index 6e8ae93..1b7a31f 100644 --- a/source/bilingual_guides/getting-started/adding-a-route-and-template.md +++ b/source/bilingual_guides/getting-started/adding-a-route-and-template.md @@ -60,6 +60,7 @@ Next, update your `index.html` to wrap the inner contents of `` in a Handl + ``` diff --git a/source/bilingual_guides/getting-started/adding-child-routes.md b/source/bilingual_guides/getting-started/adding-child-routes.md index 37c0cfa..662fa9e 100644 --- a/source/bilingual_guides/getting-started/adding-child-routes.md +++ b/source/bilingual_guides/getting-started/adding-child-routes.md @@ -14,18 +14,18 @@ In `index.html` move the entire `
    ` of todos into a new template named `todos ```html ``` @@ -33,7 +33,6 @@ Still within `index.html` place a Handlebars `{{outlet}}` helper where the `
      在`
        `原来所处位置添加一个Handlebars的`{{outlet}}`助手: - ```handlebars @@ -72,8 +71,7 @@ Todos.TodosIndexRoute = Ember.Route.extend({ }); ``` -When the application loads at the url `'/'` Ember.js will enter the `todos` route and render the `todos` template as before. It will also transition into the `todos.index` route and fill the `{{outlet}}` in the `todos` template with the `todos/index` template. The model data for this template is the result of the `model` method of `TodosIndexRoute`, which indicates that the -model for this route is the same model for the `TodosRoute`. +When the application loads at the url `'/'` Ember.js will enter the `todos` route and render the `todos` template as before. It will also transition into the `todos.index` route and fill the `{{outlet}}` in the `todos` template with the `todos/index` template. The model data for this template is the result of the `model` method of `TodosIndexRoute`, which indicates that the model for this route is the same model for the `TodosRoute`. 当应用从`'/'`加载时,Ember.js将进入`todos`路由并跟之前一样渲染`todos`模板。这也将转换到`todos.index`路由,并使用`todos/index`模板来填充`todos`模板中的`{{outlet}}`。模板使用的模型数据是`TodosIndexRoute`的`model`方法的返回的值。这表示该路由的模型与`TodoRoute`的模型相同。 diff --git a/source/bilingual_guides/getting-started/deleting-todos.md b/source/bilingual_guides/getting-started/deleting-todos.md index 245b25a..302900d 100644 --- a/source/bilingual_guides/getting-started/deleting-todos.md +++ b/source/bilingual_guides/getting-started/deleting-todos.md @@ -28,6 +28,8 @@ In `js/controllers/todo_controller.js` implement the `removeTodo` method referen // ... additional lines truncated for brevity ... // ... 为保持代码简洁,在此省略了其他代码 ... actions: { + // ... additional lines truncated for brevity ... + // ... 为保持代码简洁,在此省略了其他代码 ... removeTodo: function () { var todo = this.get('model'); todo.deleteRecord(); @@ -46,7 +48,7 @@ Because the todo is no longer part of the collection of all todos, its `
      • ` el 因为删除的待办事项不再是所有待办事项集合的一部分,因此其对应的`
      • `元素将自动的从页面上移除。如果被删除的待办事项是未完成的,那么对应的未完成待办事项的数量将减一,显示该数字的部分也将自动重新渲染。如果数量的变化导致`item`和`items`间的变形,那么对应的页面部分也将自动重新渲染。 -Reload your web browser to ensure that there are no errors and the behaviors described above occurs. +Reload your web browser to ensure that there are no errors and the behaviors described above occurs. 重新载入Web浏览器以确保没有任何错误发生,并且之前描述的行为均工作正常。 diff --git a/source/bilingual_guides/getting-started/display-a-button-to-remove-completed-todos.md b/source/bilingual_guides/getting-started/display-a-button-to-remove-completed-todos.md index d20fb0b..fd44238 100644 --- a/source/bilingual_guides/getting-started/display-a-button-to-remove-completed-todos.md +++ b/source/bilingual_guides/getting-started/display-a-button-to-remove-completed-todos.md @@ -30,7 +30,8 @@ actions: { completed.invoke('deleteRecord'); this.get('store').commit(); - } + }, + // ... additional lines truncated for brevity ... }, hasCompleted: function () { return this.get('completed') > 0; @@ -38,11 +39,11 @@ hasCompleted: function () { completed: function () { return this.filterBy('isCompleted', true).get('length'); -}.property('@each.isCompleted') +}.property('@each.isCompleted'), // ... additional lines truncated for brevity ... ``` -Reload your web browser to ensure that there are no errors and the behavior described above occurs. +Reload your web browser to ensure that there are no errors and the behavior described above occurs. 重载浏览器确保没有任何错误,并且上面描述的功能正常。 diff --git a/source/bilingual_guides/getting-started/displaying-the-number-of-incomplete-todos.md b/source/bilingual_guides/getting-started/displaying-the-number-of-incomplete-todos.md index 7cd0c9d..73cf573 100644 --- a/source/bilingual_guides/getting-started/displaying-the-number-of-incomplete-todos.md +++ b/source/bilingual_guides/getting-started/displaying-the-number-of-incomplete-todos.md @@ -23,8 +23,11 @@ Implement these properties as part of this template's controller, the `Todos.Tod 在模板的控制器`Todos.TodosController`中实现以上的属性: ```javascript -// Hint: these lines MUST NOT go into the 'actions' object. -// 提示:下面的代码不能放入'actions' +actions: { + // ... additional lines truncated for brevity ... + // ... 为保持代码简洁,在此省略了其他代码 ... +}, + // ... additional lines truncated for brevity ... // ... 为保持代码简洁,在此省略了其他代码 ... remaining: function () { @@ -62,7 +65,7 @@ The `inflection` property will return either a plural or singular version of the ### 附加资源 * [Changes in this step in `diff` format](https://github.com/emberjs/quickstart-code-sample/commit/b418407ed9666714c82d894d6b70f785674f7a45) - * [Computed Properties Guide](/guides/object-model/computed-properties/) + * [Computed Properties Guide](/guides/object-model/computed-properties/) * [用`diff`格式呈现本次修改](https://github.com/emberjs/quickstart-code-sample/commit/b418407ed9666714c82d894d6b70f785674f7a45) * [计算属性指南](/guides/object-model/computed-properties/) diff --git a/source/bilingual_guides/getting-started/obtaining-emberjs-and-dependencies.md b/source/bilingual_guides/getting-started/obtaining-emberjs-and-dependencies.md index ff2acc4..6c36530 100644 --- a/source/bilingual_guides/getting-started/obtaining-emberjs-and-dependencies.md +++ b/source/bilingual_guides/getting-started/obtaining-emberjs-and-dependencies.md @@ -10,8 +10,8 @@ TodoMVC的依赖: * [jQuery](http://code.jquery.com/jquery-1.10.2.min.js) * [Handlebars](http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-1.0.0.js) -* [Ember.js 1.0](http://builds.emberjs.com/tags/v1.0.0/ember.js) -* [Ember Data 1.0 beta](http://builds.emberjs.com/tags/v1.0.0-beta.3/ember-data.js) +* [Ember.js 1.3](http://builds.emberjs.com/tags/v1.3.0/ember.js) +* [Ember Data 1.0 beta](http://builds.emberjs.com/tags/v1.0.0-beta.5/ember-data.js) For this example, all of these resources should be stored in the folder `js/libs` located in the same location as `index.html`. Update your `index.html` to load these files by placing ` + + + + + +``` + +Then reopen the application router and add this function. It will be called when +didTransition is fired by the router. + +```js +App.Router.reopen({ + notifyGoogleAnalytics: function() { + return ga('send', 'pageview', { + 'page': this.get('url'), + 'title': this.get('url') + }); + }.on('didTransition') +}); +``` + +### Discussion + +The didTransition event is responsible for notifying listeners of any URL +changes, in this example we are getting the path after the hash in the url so we +can notify Google Analytics about moving between areas of the site. + + +### Example +JS Bin diff --git a/source/guides/cookbook/helpers_and_components/creating_reusable_social_share_buttons.md b/source/guides/cookbook/helpers_and_components/creating_reusable_social_share_buttons.md index 6d63c4a..803ac18 100644 --- a/source/guides/cookbook/helpers_and_components/creating_reusable_social_share_buttons.md +++ b/source/guides/cookbook/helpers_and_components/creating_reusable_social_share_buttons.md @@ -45,4 +45,4 @@ Twitter的控件库希望能在页面上找到一个设置了特定`data-`属性 #### 示例 -JS Bin +JS Bin diff --git a/source/guides/cookbook/working_with_objects/continuous_redrawing_of_views.md b/source/guides/cookbook/working_with_objects/continuous_redrawing_of_views.md index 901a966..3dd84cb 100644 --- a/source/guides/cookbook/working_with_objects/continuous_redrawing_of_views.md +++ b/source/guides/cookbook/working_with_objects/continuous_redrawing_of_views.md @@ -12,7 +12,7 @@ ## 讨论 -Cookbook: 持续重绘视图 +Cookbook: 持续重绘视图 ### ClockService对象 @@ -74,23 +74,21 @@ App.IntervalController = Ember.ObjectController.extend({ }); ``` -一个评论列表的控制器,为每条评论创建一个时钟实例。列表中的每条评论都有一个控制器。当一条评论被创建时,`init`方法添加一个时钟实例到评论。 +一个评论列表的控制器,每条评论在被添加到列表时,会得到一个新的时钟实例。评论条目控制器设置`seconds`绑定,用于在模板中显示评论创建了多长时间。 ```javascript App.CommentItemController = Ember.ObjectController.extend({ - init: function() { - this.set('clock', ClockService.create()); - } + seconds: Ember.computed.oneWay('clock.pulse').readOnly() }) App.CommentsController = Ember.ArrayController.extend({ needs: ['interval'], - clockBinding: 'controllers.interval.clock', itemController: 'commentItem', actions: { add: function () { this.addObject(Em.Object.create({ - comment: $('#comment').val() + comment: $('#comment').val(), + clock: ClockService.create() })); } } @@ -160,7 +158,7 @@ Ember.Handlebars.registerBoundHelper('digital_clock', function(seconds) { 源代码: -* +* 更多相关内容: diff --git a/source/guides/getting-started/accepting-edits.md b/source/guides/getting-started/accepting-edits.md index af12297..bbcc09d 100644 --- a/source/guides/getting-started/accepting-edits.md +++ b/source/guides/getting-started/accepting-edits.md @@ -33,7 +33,7 @@ Ember.Handlebars.helper('edit-todo', Todos.EditTodoView); ```handlebars {{#if isEditing}} - {{edit-todo class="edit" value=title focus-out="acceptChanges" + {{edit-todo class="edit" value=title focus-out="acceptChanges" insert-newline="acceptChanges"}} {{else}} diff --git a/source/guides/getting-started/adding-a-route-and-template.md b/source/guides/getting-started/adding-a-route-and-template.md index c4b7eae..f6aa608 100644 --- a/source/guides/getting-started/adding-a-route-and-template.md +++ b/source/guides/getting-started/adding-a-route-and-template.md @@ -41,6 +41,7 @@ Todos.Router.map(function () { + ``` diff --git a/source/guides/getting-started/adding-child-routes.md b/source/guides/getting-started/adding-child-routes.md index 635b06f..495a9ef 100644 --- a/source/guides/getting-started/adding-child-routes.md +++ b/source/guides/getting-started/adding-child-routes.md @@ -6,18 +6,18 @@ ```html ``` diff --git a/source/guides/getting-started/deleting-todos.md b/source/guides/getting-started/deleting-todos.md index 01c5e2d..7054e54 100644 --- a/source/guides/getting-started/deleting-todos.md +++ b/source/guides/getting-started/deleting-todos.md @@ -15,6 +15,7 @@ ```javascript // ... 为保持代码简洁,在此省略了其他代码 ... actions: { + // ... 为保持代码简洁,在此省略了其他代码 ... removeTodo: function () { var todo = this.get('model'); todo.deleteRecord(); diff --git a/source/guides/getting-started/display-a-button-to-remove-completed-todos.md b/source/guides/getting-started/display-a-button-to-remove-completed-todos.md index 568a9cb..b53bd2a 100644 --- a/source/guides/getting-started/display-a-button-to-remove-completed-todos.md +++ b/source/guides/getting-started/display-a-button-to-remove-completed-todos.md @@ -24,7 +24,8 @@ actions: { completed.invoke('deleteRecord'); completed.invoke('save'); - } + }, + // ... additional lines truncated for brevity ... }, hasCompleted: function () { return this.get('completed') > 0; @@ -32,7 +33,7 @@ hasCompleted: function () { completed: function () { return this.filterBy('isCompleted', true).get('length'); -}.property('@each.isCompleted') +}.property('@each.isCompleted'), // ... additional lines truncated for brevity ... ``` diff --git a/source/guides/getting-started/displaying-the-number-of-incomplete-todos.md b/source/guides/getting-started/displaying-the-number-of-incomplete-todos.md index 327345b..331d84f 100644 --- a/source/guides/getting-started/displaying-the-number-of-incomplete-todos.md +++ b/source/guides/getting-started/displaying-the-number-of-incomplete-todos.md @@ -13,7 +13,9 @@ 在模板的控制器`Todos.TodosController`中实现以上的属性: ```javascript -// 提示:下面的代码不能放入'actions' +actions: { + // ... 为保持代码简洁,在此省略了其他代码 ... +}, // ... 为保持代码简洁,在此省略了其他代码 ... remaining: function () { diff --git a/source/guides/getting-started/obtaining-emberjs-and-dependencies.md b/source/guides/getting-started/obtaining-emberjs-and-dependencies.md index 64ad900..9ef6196 100644 --- a/source/guides/getting-started/obtaining-emberjs-and-dependencies.md +++ b/source/guides/getting-started/obtaining-emberjs-and-dependencies.md @@ -4,8 +4,8 @@ TodoMVC的依赖: * [jQuery](http://code.jquery.com/jquery-1.10.2.min.js) * [Handlebars](http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-1.0.0.js) -* [Ember.js 1.0](http://builds.emberjs.com/tags/v1.0.0/ember.js) -* [Ember Data 1.0 beta](http://builds.emberjs.com/tags/v1.0.0-beta.3/ember-data.js) +* [Ember.js 1.3](http://builds.emberjs.com/tags/v1.3.0/ember.js) +* [Ember Data 1.0 beta](http://builds.emberjs.com/tags/v1.0.0-beta.5/ember-data.js) 本示例中,所有的这些资源要放在与 `index.html` 相同目录的 `js/libs` 文件夹下。更新 `index.html` 代码,在 `` 标签之前加入如下几个 `