Ember 2 Session One

Ember 2 Session One


Covering

Not covered

Conventions

What is Ember?

A Framework for Ambitious Apps

MVC

Model

View

Controller

URL -> Router - > Route Handler -> Templates COmponents -> Page
    -> Redirect to a different route -> Model -

Ember CLI

Common commands

ember new <app_name> // creates a new application
ember init // generates app structure
ember server // runs the development server and livereload
ember generate // code generation
ember install <add_on> // install an add-on
ember build // build the application for distruction
ember test // runs the test with testmem

Ember New

Structure

- app.js
- router.js
...

// configurations
bower.json //bower dependency manager, downloads from github and at an evolutionary deadend
package.json // npm dependency manager

Ember.js Directory Structure

app/
- app/app.js
- app/index.html
- app/route.js
- app.styles
- app/templates
- app/modules
dist/
public/
tests/
bower & node_modules
...

Livereload

Tells the browser to reload the web page whenever you change the file

Handlebars

Installation of Add-Ons

Ember and Babel

String interpolations

ES5

var u = "flows/" + id + ".xml";

ES6

let u = `flows/${id}.xml`

Other ES6 features, reference MDN

References

Next lesson - Promises