Skip to content

Commit

Permalink
* Beginning to incorporate review ideas from john
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyt committed Oct 9, 2014
1 parent b0c9f3f commit d485373
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spreadsheet/chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Now let’s open http://audreyt.github.io/500lines/spreadsheet/ in a browser:

### Basic Concepts

The spreadsheet spans two dimensions, with _columns_ starting from **A**, and _rows_ starting from **1**. Each _cell_ has a unique _coordinate_ (such as **A1**) and _content_ (`1874`), which belongs to one of four _types_:
The spreadsheet spans two dimensions, with _columns_ starting from **A**, and _rows_ starting from **1**. Each _cell_ has a unique _coordinate_ (such as **A1**) and _content_ (such as `1874`), which belongs to one of four _types_:

* Text: `+` in **B1** and `` in **D1**, aligned to the left.
* Number: `1874` in **A1** and `2046` in **C1**, aligned to the right.
Expand Down Expand Up @@ -116,7 +116,7 @@ The next two lines load the CSS resource, close the `head` section, and begin th
</head><body ng-app="500lines" ng-controller="Spreadsheet" ng-cloak>
```

The `ng-` attributes above tell [AngularJS](http://angularjs.org/) to use the `500lines` module’s `Spreadsheet` _controller_ function, which provides a _model_— a set of names available to _bindings_ on the document _view_. The `ng-cloak` attribute hides the document from display until the bindings are in place.
The `ng-app` and `ng-controller` attributes above tell [AngularJS](http://angularjs.org/) to call the `500lines` module’s `Spreadsheet` function, which would return a _model_: An object that provides _bindings_ on the document _view_. (The `ng-cloak` attribute hides the document from display until the bindings are in place.)

As a concrete example, when the user clicks the `<button>` defined in the next line, its `ng-click` attribute will trigger and call `reset()` and `calc()`, two named functions provided by the JS model:

Expand Down
2 changes: 1 addition & 1 deletion spreadsheet/chapter.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ _(Also available in [English](https://github.com/audreyt/500lines/blob/master/sp
</head><body ng-app="500lines" ng-controller="Spreadsheet" ng-cloak>
```

上述的 `ng-` 特性指示 [AngularJS](http://angularjs.org/) 運行 `500lines` 模組中的 `Spreadsheet` 控制器(controller)函式來建立模型(model),也就是一組可以在文件顯示層(view)中進行繫結(binding)的名稱。`ng-cloak` 特性會先隱藏文件顯示,直到繫結已經就位為止。
上述的 `ng-` 特性指示 [AngularJS](http://angularjs.org/) 運行 `500lines` 模組中的 `Spreadsheet` 控制器(controller)函式來取得模型(model)物件,來為文件顯示層(view)提供繫結(binding)。(`ng-cloak` 特性會先隱藏文件,等到繫結已經就位再顯示。)

舉個具體的例子,當使用者點擊下一行中所定義的 `<button>` ,其 `ng-click` 特性會觸發並執行 `reset()``calc()` 這兩個由 JS 模型提供的函式:

Expand Down

0 comments on commit d485373

Please sign in to comment.