Ember 2 Session Three

Ember 2 Session Three


Ember Templates

Expressions

model.xx

Built-in Helpers

- link-to
- outlet

Conditionals

#if vs. Inline if

Separation of View vs. Logic

Use Computed Property as needed, keep in mind your template provide helpers

Other helpers

unless
eq
lg
format-number

You can write your own custom helpers

Debugger for views

What if you have some bugs in your handlebar expressions, like a typo? Failure is silent. Use:

  1. Log ```javascript

2. Debugger
```javascript

In Chrome Console, do

get("row")

Ember Object

Why Ember Objects vs Plain Old Javascript Objects?

  1. can observe computed property changes - the biggest selling point, a change in one computed property will flow into all other computed properties
  2. lifecycle hooks
  3. mixins
Person = Ember.Object.extend({ 
  init() {
    this._super(..argument)
  } 
})
..

Person.create()
p.get
p.set

Computed Properties Macros

Components

Components vs. Controllers

tagName and ClassName

Effective use of blocks and yields in the parent

Susan: TODO